Skip to content

Fix bug in inlineCompletionsModel.ts#292824

Open
a-stewart wants to merge 1 commit intomicrosoft:mainfrom
a-stewart:bug-in-inlineCompletionsModel
Open

Fix bug in inlineCompletionsModel.ts#292824
a-stewart wants to merge 1 commit intomicrosoft:mainfrom
a-stewart:bug-in-inlineCompletionsModel

Conversation

@a-stewart
Copy link
Copy Markdown
Contributor

this._getMetadata accepts arguments, completion: InlineSuggestionItem, languageId: string, type: 'word' | 'line' | undefined = undefined

The second argument is languageId: string.

On line 1099, it is called with this._getMetadata(completion, type) which is allowed before type is optional, and 'word' | 'line' is a valid string.

The result of this is an event is fired with langaugeId set as word or line.

This PR fixes that trivially.

A better solution though would likely be to remove language: string from the method entirely, since this.textModel.getLanguageId() is available from within the method anyway.

@hediet
Copy link
Copy Markdown
Member

hediet commented Mar 17, 2026

Thanks!

@hediet hediet enabled auto-merge (rebase) March 17, 2026 11:29
@vs-code-engineering vs-code-engineering bot added this to the 1.113.0 milestone Mar 17, 2026
@a-stewart
Copy link
Copy Markdown
Contributor Author

Thanks for the review - I think that you will need to merge it too though and approve running the tests as I don't have permissions to do that.

@jrieken jrieken modified the milestones: 1.113.0, On Deck Mar 25, 2026
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.

3 participants