Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to disable language-server completions by selector #2581

Open
deathaxe opened this issue Dec 15, 2024 · 0 comments
Open

Ability to disable language-server completions by selector #2581

deathaxe opened this issue Dec 15, 2024 · 0 comments

Comments

@deathaxe
Copy link
Contributor

Environment

  1. Install LSP and LSP-lemminx
  2. install XSL package
  3. create a new XML stylesheet
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				version="2.0">
	<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>

	<xsl:template match="/">
		{ | }
	</xsl:template>
</xsl:stylesheet>

The problem

LemMinX is designed to provide completions for XML files using XML schemas, very much like LSP-json does.

It does however not have any idea of XSL syntax itself or possible interpolations added by templating syntaxes.

Hence it handles { | } in above snippet as plain text content. It doesn't know about it being a XPath interpolation which requires different treatment.

As a result, if auto-completions are triggerd in between those braces, LemMinX suggests xsl:foo tags supressing static XPath completions from XSL package.

The idea

Such language server limitiation could be worked around by suppressing LSP completions within certain scopes.

On discord it was suggested to specify e.g. "auto_complete_selector": "text.xml - text.xml meta.embedded - text.xml meta.interpolation", in "LSP-lemminx.sublime-settings".

It does not work. Still see completions from LemMinX.

grafik

Description of "auto_complete_selector" also notes to not intend to override global auto_complete_selector. Further more this selector does not suppress auto completion queries completely, but only automatic queries while typing.

Hence current meaning/implementation of that setting is insufficient to suppress completion queries for certain selectors.

Alternative

Feature request for LemMinX to ignore interpolations.

I don't know how feasable that is, as development of LemMinX has slowed down significantly, recently.

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

No branches or pull requests

1 participant