wkillerud / some-sass

Improved support for SCSS, Sass indented and SassDoc. Workspace awareness and full support for Sass modules.
https://wkillerud.github.io/some-sass/
60 stars 6 forks source link

Tab completion removes namespace definition inside custom Sublime Text implementation #226

Closed niksy closed 2 months ago

niksy commented 2 months ago

In which editor is this a problem?

Sublime Text

Describe the bug

I’m using custom LSP client inside Sublime Text and everything works really well, except that when you activate tab completion on namespace, namespace definition gets removed.

It’s best visible in this video:

https://github.com/user-attachments/assets/a9daf5a7-06e4-4d25-8a4f-27af94f619be

Same behavior works well for other language servers such as TypeScript, PHP and others.

Is this something specific to Some Sass?

What's the expected result?

Initial namespace is left as-is and completion value is appended.

Link to minimal reproducible example

No response

Participation

wkillerud commented 2 months ago

Hi @niksy

Could you share your SublimeText LSP config? I might be able to add a setting that can fix this problem, but it's easier if I can reproduce the problem on my machine.

niksy commented 2 months ago

You can actually install it with Package Control by adding repository:

https://github.com/niksy/LSP-sass

I haven’t published it to Package Control repository since it’s still work in progress, but I plan to!

wkillerud commented 2 months ago

Thank you @niksy, I got it working 👍

229 fixed the problem for me, using the new setting feature for afterModule. It's out now in version 1.8.0.

A note, I see two settings that have the wrong name in niksy/LSP-sass. It should be somesass.completion.afterModule and somesass.completion.beforeVariable.

{
    "command": ["${node_bin}", "${server_path}", "--stdio"],
    "settings": {
        "somesass.loadPaths": [],
        "somesass.scannerDepth": 30,
        "somesass.scannerExclude": [
            "**/.git/**",
            "**/node_modules/**",
            "**/bower_components/**",
        ],
        "somesass.scanImportedFiles": true,
        "somesass.suggestionStyle": "all",
        "somesass.suggestAllFromOpenDocument": false,
        "somesass.suggestFromUseOnly": false,
        "somesass.suggestFunctionsInStringContextAfterSymbols": " (+-*%",
-       "somesass.afterModule": "",
-       "somesass.beforeVariable": "",
+       "somesass.completion.afterModule": "{module}",
+       "somesass.completion.beforeVariable": "",
    },
    "selector": "source.scss | text.html.vue"
}

If you update the language server version to 1.8.0 and change the settings to what I show above it should work properly for you.

niksy commented 2 months ago

This is it, thank you very much!