Skip to content

Fix within string subset completions on non-syntactic names - #1353

Open
DavisVaughan wants to merge 1 commit into
mainfrom
fix/string-quote
Open

Fix within string subset completions on non-syntactic names#1353
DavisVaughan wants to merge 1 commit into
mainfrom
fix/string-quote

Conversation

@DavisVaughan

Copy link
Copy Markdown
Contributor

Closes posit-dev/positron#14909

Changed from enquote: bool to

pub(super) enum QuoteStyle {
    // Double quote with `"`
    Double,

    // Backtick with `\`` if the symbol isn't syntactic
    BacktickIfNotSyntactic,

    // No quoting. Useful if you know you're already inserting into an existing string.
    None,
}

It was a bit weird before, but the previous mapping was:

  • enquote: true -> QuoteStyle::Double
  • enquote: false -> QuoteStyle::BacktickIfNotSyntactic

So we previously had no way to say "please just take this as is, I know what I'm doing", which is the case of x["<TAB>"] where we are completing within an existing string and we don't want any quoting whatsoever.

@DavisVaughan
DavisVaughan requested a review from lionel- July 17, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

String autocompletion in square brackets inserts backticks when it shouldn't

1 participant