Skip to content

changes to support inline completion#1151

Merged
angelozerr merged 2 commits into
redhat-developer:mainfrom
venmanyarun:xml_inline_completion
Jun 10, 2026
Merged

changes to support inline completion#1151
angelozerr merged 2 commits into
redhat-developer:mainfrom
venmanyarun:xml_inline_completion

Conversation

@venmanyarun

Copy link
Copy Markdown
Contributor

Fixes eclipse-lemminx/lemminx#1780
Language Server PR:- eclipse-lemminx/lemminx#1784

Please make sure to build LS in local using npm run build-server as LS changes are not released as snapshot

Comment thread src/client/xmlClient.ts
const languageClientOptions: LanguageClientOptions = getLanguageClientOptions(logfile, externalXmlSettings, requirementsData, context);
languageClient = new LanguageClient('xml', 'XML Support', executable, languageClientOptions);

languageClient.registerProposedFeatures();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you need to do that, please add comments to explain why you need to do that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In vscode-languageclient version 9.0.0, inline completion (textDocument/inlineCompletion) is a proposed feature. This means you must call client.registerProposedFeatures() in your client extension code for inline completions to work

const workEdits = new WorkspaceEdit();
for (const edit of lspTextDocumentEdit.edits) {
workEdits.replace(documentURI, languageClient.protocol2CodeConverter.asRange(edit.range), edit.newText);
if ('newText' in edit) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about other usecases?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only scenario where we are using lspTextDocumentEdit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment

Comment thread package.json
"jdk-utils": "^0.4.3",
"path-exists": "^4.0.0",
"vscode-languageclient": "^8.0.1",
"vscode-languageclient": "^9.0.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you are not using 1.0.0 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10.0.0 is a major release

Package Export Rules: The library strictly utilizes the exports subpath property in its package.json file rather than older main and typings properties. This means explicit subpath imports like vscode-languageclient/node or vscode-languageclient/browser must be configured correctly alongside a matching moduleResolution (such as node16 or nodenext) in your tsconfig.json.

Minimum Engine Requirements: This version increases the minimum VS Code host editor requirement to ^1.91.0 or newer.

Runtime Dependencies: Built using TypeScript 5.9.x, the library compiles targeting Node.js 22.13.14 and es2022 specifications

This would introduce significant changes.. for LSP 3.18 to work, 9.0.0 is enough

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your explanation.

@angelozerr angelozerr merged commit ac784ed into redhat-developer:main Jun 10, 2026
5 of 6 checks passed
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.

Add support for textDocument/inlineCompletion

2 participants