Skip to content

feat(lsp): complete closing triple-quoted strings - #4737

Open
mangeshraut712 wants to merge 13 commits into
meta:mainfrom
mangeshraut712:feat/triple-quoted-string-completions
Open

mangeshraut712 wants to merge 13 commits into
meta:mainfrom
mangeshraut712:feat/triple-quoted-string-completions

Conversation

@mangeshraut712

@mangeshraut712 mangeshraut712 commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #4346.

When the cursor is immediately after exactly three matching quotes (""" or '''), offer a triple-quoted string completion that inserts the matching closer after the cursor. When the client supports snippets, the cursor placeholder is placed before the closer.

  • Supports valid Python string prefixes: r, u, f, b, fr, rf, br, and rb.
  • Does not offer a completion after one or two quotes, which already open ordinary string literals.
  • Does not offer a completion when matching closing triple quotes already follow, after a non-prefix identifier, or inside an existing string or comment.

AI usage: an assistant drafted the completion helper and tests; I reviewed the LSP edit ranges, prefix handling, and test cursors.

Test Plan

cargo test -p pyrefly --lib completion_

@meta-cla

meta-cla Bot commented Aug 30, 2026

Copy link
Copy Markdown

Hi @mangeshraut712!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla

meta-cla Bot commented Aug 30, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@github-actions
github-actions Bot requested a review from samwgoldman August 31, 2026 09:26
@cursor
cursor Bot force-pushed the feat/triple-quoted-string-completions branch from e7b7748 to 55ebe4a Compare September 6, 2026 15:03
@github-actions github-actions Bot added size/l and removed size/l labels Sep 6, 2026
@meta-codesync

meta-codesync Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D119010817. (Because this pull request was imported automatically, there will not be any future comments.)

@github-actions github-actions Bot added size/l and removed size/l labels Sep 6, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added size/l and removed size/l labels Sep 11, 2026
@github-actions

This comment has been minimized.

@cursor
cursor Bot force-pushed the feat/triple-quoted-string-completions branch from 3bb0928 to dd4e429 Compare September 21, 2026 05:18
@github-actions github-actions Bot added size/l and removed size/l labels Sep 21, 2026
@cursor
cursor Bot force-pushed the feat/triple-quoted-string-completions branch from dd4e429 to cff85b2 Compare September 22, 2026 05:15
@github-actions github-actions Bot added size/l and removed size/l labels Sep 22, 2026
@github-actions

This comment has been minimized.

@mangeshraut712

Copy link
Copy Markdown
Contributor Author

CLA is signed and the diff has been imported. mypy_primer reports no type-check changes on the corpus. This completes closing triple-quoted strings in the LSP. Could a maintainer review when you have a moment?

@cursor
cursor Bot force-pushed the feat/triple-quoted-string-completions branch from febdd22 to e43705b Compare September 28, 2026 05:11
@github-actions github-actions Bot removed the size/l label Sep 28, 2026
@github-actions

This comment has been minimized.

BSD head rejects -n 0; use dd bs=1 count=0 so the scrut pipe-close
examples stay portable (same as meta#5390).
@github-actions github-actions Bot added size/xl and removed size/xl labels Oct 26, 2026
@github-actions

This comment has been minimized.

# Conflicts:
#	pyrefly/lib/test/lsp/completion.rs
@github-actions github-actions Bot added size/xl and removed size/xl labels Oct 27, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added size/xl and removed size/xl labels Oct 27, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added size/xl and removed size/xl labels Oct 27, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added size/xl and removed size/xl labels Oct 27, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added size/xl and removed size/xl labels Oct 28, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added size/xl and removed size/xl labels Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide completions for triple quoted strings

2 participants