Getting unexpected underlines: possibly `document_highlight_style: ""` stopped working
Jimbly opened this issue · comments
Describe the bug
I restarted Sublime today (first time in probably many months, so unsure when this last worked), and now whatever token my cursor is over is getting underlined, as well as any nearby occurrences of it. From the comments in the configuration file, it looks like I have had "document_highlight_style": ""
set in my local config, but now it's getting ignored. Changing it to "document_highlight_style": "stippled"
doesn't change the behavior though, so some chance this is coming from something else (LSP-typescript
is the only other thing LSP-related I have installed). The underline goes away if I disable the LSP
package.
To Reproduce
Steps to reproduce the behavior:
- Set
document_highlight_style
in your local config - Create a TypeScript file like this:
export function foo(): void {
let bar = 1;
console.log(bar);
}
- Put cursor on
bar
- See
bar
underlined regardless of setting
Expected behavior
Previously did not get underline showing up. Especially distracting when it's overlapping with Sublime's own match_selection
option.
Environment (please complete the following information):
- OS: Windows 11
- Sublime Text version: 4143
- LSP version: v1.24.0
- Language servers used: LSP-typescript v2.4.0
Further investigation seems to indicate that all settings in my LSP.sublime-settings
file are being ignored, not just this one. I've tried deleting the file and letting the Preferences: LSP Settings
palette action re-create it, and still no luck.
Can you provide output of LSP: Troubleshoot Server
?
Thanks for responding! Sure, here ya go (it seems to show the correct settings here, however I'm still seeing the underlining and hint
-level messages in the LSP Diagnostics panel).
Troubleshooting: LSP-typescript
Version
- LSP: 1.24.0
- Sublime Text: 4143
Server Test Run
- exit code: 0
- output
Server Configuration
- command
[
"${node_bin}",
"${server_path}",
"--stdio"
]
- shell command
"C:\Program Files\nodejs\node.EXE" "C:\Apps\Sublime Text 4\Data\Package Storage\LSP-typescript\16.13.2\typescript-language-server\node_modules\typescript-language-server\lib\cli.mjs" --stdio
- selector
source.js, source.jsx, source.ts, source.tsx
- priority_selector
source.js, source.jsx, source.ts, source.tsx
- init_options
{
"completionDisableFilterText": true,
"disableAutomaticTypingAcquisition": false,
"locale": "en",
"logVerbosity": "off",
"maxTsServerMemory": 0,
"npmLocation": "",
"plugins": [],
"preferences": {
"allowIncompleteCompletions": true,
"allowRenameOfImportPath": true,
"allowTextChangesInNewFiles": true,
"autoImportFileExcludePatterns": [],
"disableSuggestions": false,
"displayPartsForJSDoc": true,
"generateReturnInDocTemplate": true,
"importModuleSpecifierEnding": "auto",
"importModuleSpecifierPreference": "shortest",
"includeAutomaticOptionalChainCompletions": true,
"includeCompletionsForImportStatements": true,
"includeCompletionsForModuleExports": true,
"includeCompletionsWithClassMemberSnippets": true,
"includeCompletionsWithInsertText": true,
"includeCompletionsWithObjectLiteralMethodSnippets": true,
"includeCompletionsWithSnippetText": true,
"includePackageJsonAutoImports": "auto",
"jsxAttributeCompletionStyle": "auto",
"lazyConfiguredProjectsFromExternalProject": false,
"organizeImportsAccentCollation": true,
"organizeImportsCaseFirst": false,
"organizeImportsCollation": "ordinal",
"organizeImportsCollationLocale": "en",
"organizeImportsIgnoreCase": "auto",
"organizeImportsNumericCollation": false,
"providePrefixAndSuffixTextForRename": true,
"provideRefactorNotApplicableReason": true,
"quotePreference": "auto",
"useLabelDetailsInCompletionEntries": true
},
"tsserver": {
"logDirectory": "",
"logVerbosity": "off",
"path": "",
"trace": "off",
"useSyntaxServer": "auto"
}
}
- settings
{
"diagnostics": {
"ignoredCodes": []
},
"implicitProjectConfiguration": {
"checkJs": false,
"experimentalDecorators": false,
"module": "ESNext",
"strictFunctionTypes": true,
"strictNullChecks": true,
"target": "ES2020"
},
"javascript": {
"format": {
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterConstructor": false,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceAfterTypeAssertion": false,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceBeforeFunctionParenthesis": false,
"insertSpaceBeforeTypeAnnotation": false,
"placeOpenBraceOnNewLineForControlBlocks": false,
"placeOpenBraceOnNewLineForFunctions": false,
"semicolons": "ignore",
"trimTrailingWhitespace": true
},
"inlayHints": {
"includeInlayEnumMemberValueHints": false,
"includeInlayFunctionLikeReturnTypeHints": false,
"includeInlayFunctionParameterTypeHints": false,
"includeInlayParameterNameHints": "none",
"includeInlayParameterNameHintsWhenArgumentMatchesName": false,
"includeInlayPropertyDeclarationTypeHints": false,
"includeInlayVariableTypeHints": false,
"includeInlayVariableTypeHintsWhenTypeMatchesName": false
}
},
"statusText": "$version, $source",
"typescript": {
"format": {
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterConstructor": false,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceAfterTypeAssertion": false,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceBeforeFunctionParenthesis": false,
"insertSpaceBeforeTypeAnnotation": false,
"placeOpenBraceOnNewLineForControlBlocks": false,
"placeOpenBraceOnNewLineForFunctions": false,
"semicolons": "ignore",
"trimTrailingWhitespace": true
},
"inlayHints": {
"includeInlayEnumMemberValueHints": false,
"includeInlayFunctionLikeReturnTypeHints": false,
"includeInlayFunctionParameterTypeHints": false,
"includeInlayParameterNameHints": "none",
"includeInlayParameterNameHintsWhenArgumentMatchesName": false,
"includeInlayPropertyDeclarationTypeHints": false,
"includeInlayVariableTypeHints": false,
"includeInlayVariableTypeHintsWhenTypeMatchesName": false
}
}
}
- env
{
"PATH": "C:\\Program Files\\nodejs;C:\\Program Files\\nodejs;C:\\Program Files\\nodejs;C:\\Program Files\\nodejs;C:\\Program Files\\nodejs;"
}
Active view
- File name
C:\path\file.ts
- Settings
{
"auto_complete_selector": "meta.tag, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc",
"lsp_active": true,
"syntax": "Packages/JavaScript/TypeScript.sublime-syntax"
}
- base scope
source.ts
Project / Workspace
- folders
[
"C:\\path"
]
- is project: True
- project data:
{
"folders": [
{
"binary_file_patterns": [
"*.glb",
"*.gltf",
"*.gz",
"*.mp3",
"*.ogg",
"*.wav",
"*.xraw",
"font/*.json",
"package-lock.json"
],
"file_exclude_patterns": [
"*.00?"
],
"folder_exclude_patterns": [
"node_modules",
".gbcache",
".gbstate",
"build.dev",
"build.prod",
"build.test",
"logs",
"data_store",
"data_restore",
"mobile",
"log_filter/out"
],
"path": "."
}
]
}
LSP configuration
{
"diagnostics_panel_include_severity_level": 3,
"document_highlight_style": "",
"inhibit_word_completions": false,
"link_highlight_style": "",
"show_code_actions": "",
"show_diagnostics_severity_level": 3
}
System PATH
- J:\Oculus\Support\oculus-runtime
- C:\Windows\system32
- C:\Windows
- C:\Windows\System32\Wbem
- C:\Windows\System32\WindowsPowerShell\v1.0\
- C:\Windows\System32\OpenSSH\
- C:\bin\Python27
- C:\bin\Python27\Scripts
- C:\Program Files\TortoiseSVN\bin
- C:\Program Files\nodejs\
- C:\Program Files\dotnet\
- C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
- C:\bin
- C:\bin\git\cmd
- C:\Users\waste\AppData\Local\Microsoft\WindowsApps
- C:\Users\waste\AppData\Roaming\npm
- C:\Program Files\Docker\Docker\resources\bin
Is there an easy-ish way to grab old versions of the LSP package? I'd happily grab an old one (or do a git bisect if it's as simple as cloning this repo into the appropriate package folder?) and narrow down the cause (and get a temporary workaround in place).
Cloning the LSP repo into the packages folder is exactly what you need to do.
I restarted Sublime this morning to find LSP 1.25.0
installed, and the problem has gone away, configuration file is now being respected (though nothing relevant in the changelog, it seems, though I see some changes in the diff to WindowConfigManager, so that seems related). Closing this issue as apparently it's been resolved.