yegappan / lsp

Language Server Protocol (LSP) plugin for Vim9
MIT License
445 stars 42 forks source link

Assistance with adding sonarlint-ls support #520

Open jclsn opened 1 month ago

jclsn commented 1 month ago

Trying to use sonarlint-ls with lsp

There exists a coc plugin and I have tried to the same arguments from here

This is what I have so far

        \ #{name: 'sonarlint-ls',
        \   filetype: ['c', 
        \              'cpp', 
        \              'go', 
        \              'html',  
        \              'java',
        \              'javascript', 
        \              'php', 
        \              'python',
        \              'terraform',
        \              'xml'],
        \   path: '/usr/bin/sonarlint-ls',
        \   args: [
        \          '-stdio', 
        \          '-analyzers', 
        \          '/usr/share/java/sonarlint-ls/analyzers/sonarcfamily.jar',
        \          '/usr/share/java/sonarlint-ls/analyzers/sonargo.jar',
        \          '/usr/share/java/sonarlint-ls/analyzers/sonarhtml.jar',
        \          '/usr/share/java/sonarlint-ls/analyzers/sonariac.jar',
        \          '/usr/share/java/sonarlint-ls/analyzers/sonarjava.jar',
        \          '/usr/share/java/sonarlint-ls/analyzers/sonarjs.jar',
        \          '/usr/share/java/sonarlint-ls/analyzers/sonarlintomnisharp.jar',
        \          '/usr/share/java/sonarlint-ls/analyzers/sonarphp.jar',
        \          '/usr/share/java/sonarlint-ls/analyzers/sonarpython.jar',
        \          '/usr/share/java/sonarlint-ls/analyzers/sonartext.jar',
        \          '/usr/share/java/sonarlint-ls/analyzers/sonarxml.jar',
        \   ],
        \   debug: v:true,
        \   syncInit: v:true,
    \   initializationOptions: #{
        \       sonarlint: #{
        \         pathToCompileCommands: './build/compile_commands.json'
        \       }
    \   }
    \   }
        \ },

It starts up fine. Sonarlint needs to be informed about the compile_commands.json somehow. No idea how to do that in lsp. For coc I would add this

"sonarlint.pathToCompileCommands": "${workspaceFolder}/build/compile_commands.json"

Server and debug output:

Server messages:

'/usr/bin/sonarlint-ls' Language Server Messages
================================================
05/26/24 08:48:08: [Log]: [Info  - 08:48:08.328] SonarLint backend started, instance=org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl@6bd61f98
05/26/24 08:48:08: [Log]: [Debug - 08:48:08.418] Folder WorkspaceFolder[name=constexpr,uri=file:///home/jan/Workspace/constexpr/] added
05/26/24 08:49:08: [Log]: [Error - 08:49:08.420] Failed to initialize workspace folders

Debug messages:

05/27/24 16:44:21: Sent {'method': 'initialize', 'params': {'rootUri': 'file:///home/jan/Workspace/constexpr/', 'initializationOptions': {'sonarlint': {'pathToCompileCommands': './build/compile_commands.json'}}, 'workspaceFolders': [{'uri': 'file:///home/jan/Workspace/constexpr/', 'name': 'constexpr'}], 'rootPath': '/home/jan/Workspace/constexpr', 'clientInfo': {'version': '9010429', 'name': 'Vim'}, 'processId': 169055, 'trace': 'off', 'capabilities': {'workspace': {'workspaceFolders': true, 'configuration': true, 'workspaceEdit': {'resourceOperations': ['rename', 'create', 'delete']}, 'symbol': {'dynamicRegistration': false}, 'applyEdit': true}, 'offsetEncoding': ['utf-32', 'utf-16', 'utf-8'], 'window': {}, 'general': {'positionEncodings': ['utf-32', 'utf-16', 'utf-8']}, 'textDocument': {'callHierarchy': {'dynamicRegistration': false}, 'rename': {'prepareSupport': false, 'dynamicRegistration': false}, 'codeAction': {'isPreferredSupport': true, 'disabledSupport': true, 'codeActionLiteralSupport': {'codeActionKind': {'valueSet': ['', 'quickfix', 'refactor', 'refactor.extract', 'refactor.inline', 'refactor.rewrite', 'source', 'source.organizeImports']}}, 'dynamicRegistration': false}, 'completion': {'completionItem': {'insertReplaceSupport': false, 'snippetSupport': true, 'resolveSupport': {'properties': ['detail', 'documentation']}, 'documentationFormat': ['markdown', 'plaintext']}, 'dynamicRegistration': false, 'completionItemKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}}, 'formatting': {'dynamicRegistration': false}, 'codeLens': {'dynamicRegistration': false}, 'inlayHint': {'dynamicRegistration': false}, 'hover': {'dynamicRegistration': false, 'contentFormat': ['markdown', 'plaintext']}, 'rangeFormatting': {'dynamicRegistration': false}, 'declaration': {'dynamicRegistration': false, 'linkSupport': true}, 'references': {'dynamicRegistration': false}, 'selectionRange': {'dynamicRegistration': false}, 'typeHierarchy': {'dynamicRegistration': false}, 'foldingRange': {'rangeLimit': 5000, 'foldingRange': {'collapsedText': true}, 'dynamicRegistration': false, 'foldingRangeKind': {'valueSet': ['comment', 'imports', 'region']}, 'lineFoldingOnly': true}, 'documentSymbol': {'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}, 'dynamicRegistration': false, 'labelSupport': false, 'hierarchicalDocumentSymbolSupport': true}, 'publishDiagnostics': {'dataSupport': true, 'relatedInformation': false, 'codeDescriptionSupport': true, 'versionSupport': true}, 'synchronization': {'didSave': true, 'WillSaveWaitUntil': false, 'willSave': false, 'dynamicRegistration': false}, 'documentHighlight': {'dynamicRegistration': false}, 'implementation': {'dynamicRegistration': false, 'linkSupport': true}, 'typeDefinition': {'dynamicRegistration': false, 'linkSupport': true}, 'semanticTokens': {'serverCancelSupport': false, 'requests': {'full': {'delta': true}, 'range': false}, 'multilineTokenSupport': false, 'dynamicRegistration': false, 'overlappingTokenSupport': false, 'tokenTypes': ['type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator'], 'tokenModifiers': ['declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary'], 'formats': ['relative'], 'augmentsSyntaxTokens': true}, 'signatureHelp': {'signatureInformation': {'activeParameterSupport': true, 'documentationFormat': ['markdown', 'plaintext']}, 'dynamicRegistration': false}, 'definition': {'dynamicRegistration': false, 'linkSupport': true}}}}}
05/27/24 16:44:22: Received {'method': 'window/logMessage', 'jsonrpc': '2.0', 'params': {'message': '[Info  - 16:44:22.554] SonarLint backend started, instance=org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl@6bd61f98', 'type': 4}}
05/27/24 16:44:22: Received {'method': 'window/logMessage', 'jsonrpc': '2.0', 'params': {'message': '[Debug - 16:44:22.642] Folder WorkspaceFolder[name=constexpr,uri=file:///home/jan/Workspace/constexpr/] added', 'type': 4}}
05/27/24 16:44:22: Received {'id': 1, 'jsonrpc': '2.0', 'result': {'capabilities': {'executeCommandProvider': {'workDoneProgress': true, 'commands': ['SonarLint.QuickFixApplied', 'SonarLint.OpenRuleDescCodeAction', 'SonarLint.OpenStandaloneRuleDesc', 'SonarLint.BrowseTaintVulnerability', 'SonarLint.ShowTaintVulnerabilityFlows']}, 'workspace': {'workspaceFolders': {'changeNotifications': true, 'supported': true}}, 'codeActionProvider': true, 'textDocumentSync': {'change': 1, 'openClose': true}}, 'serverInfo': {'version': '3.5.1.75119', 'name': 'SonarLint Language Server'}}}
05/27/24 16:44:22: Received {'id': '1', 'jsonrpc': '2.0', 'method': 'sonarlint/shouldAnalyseFile', 'params': {'uri': 'file:///home/jan/Workspace/constexpr/constexpr.cpp'}}
05/27/24 16:45:22: Received {'method': 'window/logMessage', 'jsonrpc': '2.0', 'params': {'message': '[Error - 16:45:22.644] Failed to initialize workspace folders', 'type': 4}}
05/27/24 16:45:42: Received {'id': '2', 'jsonrpc': '2.0', 'method': 'sonarlint/shouldAnalyseFile', 'params': {'uri': 'file:///home/jan/Workspace/constexpr/constexpr.cpp'}}
05/27/24 16:45:44: Received {'id': '3', 'jsonrpc': '2.0', 'method': 'sonarlint/shouldAnalyseFile', 'params': {'uri': 'file:///home/jan/Workspace/constexpr/constexpr.cpp'}}

or here in a pastebin: https://0x0.st/XZFy.txt

atgote commented 1 month ago

Actually looks like sonarlint language server expects this path to be in the workspaceConfig. Try to update your config as follows:

        \ #{name: 'sonarlint-ls',
        \     ...
    \     workspaceConfig: #{        " <<<< this is instead of 'initializationOptions'
        \         sonarlint: #{
        \             pathToCompileCommands: './build/compile_commands.json'
        \         }
    \     }
    \   }
jclsn commented 1 month ago

@atgote I already tried that. It then tells me about an unsupported message from lsp. I looked into the CoC and Neovim LSP plugins. Seems like they contain a lot of the VSCode plugin code. Not sure if this is even possible sending just stand LSP messages to the server. One of the Sonarqube devs gave some hints here though

Here are the logs

'/usr/bin/sonarlint-ls' Language Server Messages
================================================
06/03/24 23:28:15: [Log]: [Info  - 23:28:15.457] SonarLint backend started, instance=org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl@6bd61f98
06/03/24 23:28:15: [Log]: [Debug - 23:28:15.566] Folder WorkspaceFolder[name=constexpr,uri=file:///home/jan/Workspace/C%2b%2b/constexpr/] added
06/03/24 23:28:15: [Log]: [Debug - 23:28:15.616] Fetching global configuration
06/03/24 23:28:17: [Log]: [Warn  - 23:28:17.273] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.ConnectionService': Unsatisfied dependency expressed through constructor parameter 4; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.TokenGeneratorHelper': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.embedded.server.EmbeddedServer': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.embedded.server.ShowHotspotRequestHandler': Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryService': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryLocalStorageManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telemetryPath' defined in org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.nio.file.Path]: Factory method 'provideTelemetryPath' threw exception; nested exception is java.lang.NullPointerException
06/03/24 23:28:17: [Log]: [Error - 23:28:17.301] Internal error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.ConnectionService': Unsatisfied dependency expressed through constructor parameter 4; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.TokenGeneratorHelper': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.embedded.server.EmbeddedServer': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.embedded.server.ShowHotspotRequestHandler': Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryService': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryLocalStorageManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telemetryPath' defined in org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.nio.file.Path]: Factory method 'provideTelemetryPath' threw exception; nested exception is java.lang.NullPointerException
06/03/24 23:28:17: [Log]: [Error - 23:28:17.301] java.util.concurrent.CompletionException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.ConnectionService': Unsatisfied dependency expressed through constructor parameter 4; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.TokenGeneratorHelper': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.embedded.server.EmbeddedServer': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.embedded.server.ShowHotspotRequestHandler': Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryService': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryLocalStorageManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telemetryPath' defined in org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.nio.file.Path]: Factory method 'provideTelemetryPath' threw exception; nested exception is java.lang.NullPointerException
    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
    at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649)
    at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1570)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.ConnectionService': Unsatisfied dependency expressed through constructor parameter 4; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.TokenGeneratorHelper': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.embedded.server.EmbeddedServer': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.embedded.server.ShowHotspotRequestHandler': Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryService': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryLocalStorageManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telemetryPath' defined in org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.nio.file.Path]: Factory method 'provideTelemetryPath' threw exception; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:224)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:921)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
    at org.sonarsource.sonarlint.core.spring.SpringApplicationContextInitializer.<init>(SpringApplicationContextInitializer.java:40)
    at org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl.lambda$initialize$3(SonarLintRpcServerImpl.java:139)
    at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
    ... 4 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.TokenGeneratorHelper': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.embedded.server.EmbeddedServer': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.embedded.server.ShowHotspotRequestHandler': Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryService': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryLocalStorageManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telemetryPath' defined in org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.nio.file.Path]: Factory method 'provideTelemetryPath' threw exception; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:224)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:911)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
    ... 19 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.embedded.server.EmbeddedServer': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.embedded.server.ShowHotspotRequestHandler': Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryService': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryLocalStorageManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telemetryPath' defined in org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.nio.file.Path]: Factory method 'provideTelemetryPath' threw exception; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:224)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:911)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
    ... 33 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.embedded.server.ShowHotspotRequestHandler': Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryService': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryLocalStorageManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telemetryPath' defined in org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.nio.file.Path]: Factory method 'provideTelemetryPath' threw exception; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:224)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:911)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
    ... 47 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryService': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryLocalStorageManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telemetryPath' defined in org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.nio.file.Path]: Factory method 'provideTelemetryPath' threw exception; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:224)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:911)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
    ... 61 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryLocalStorageManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telemetryPath' defined in org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.nio.file.Path]: Factory method 'provideTelemetryPath' threw exception; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:224)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:911)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
    ... 75 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.sonarlint.core.telemetry.TelemetryLocalStorageManager': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telemetryPath' defined in org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.nio.file.Path]: Factory method 'provideTelemetryPath' threw exception; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:224)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:911)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
    ... 89 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telemetryPath' defined in org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.nio.file.Path]: Factory method 'provideTelemetryPath' threw exception; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:633)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:911)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
    ... 103 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.nio.file.Path]: Factory method 'provideTelemetryPath' threw exception; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:648)
    ... 117 common frames omitted
Caused by: java.lang.NullPointerException: null
    at java.base/java.util.Objects.requireNonNull(Objects.java:220)
    at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:297)
    at java.base/java.nio.file.Path.resolve(Path.java:516)
    at org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig.provideTelemetryPath(TelemetrySpringConfig.java:44)
    at org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig$$EnhancerBySpringCGLIB$$c316b28.CGLIB$provideTelemetryPath$0(<generated>)
    at org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig$$EnhancerBySpringCGLIB$$c316b28$$FastClassBySpringCGLIB$$e8ed26c0.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
    at org.sonarsource.sonarlint.core.telemetry.TelemetrySpringConfig$$EnhancerBySpringCGLIB$$c316b28.provideTelemetryPath(<generated>)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
    ... 118 common frames omitted
06/03/24 23:28:17: [Log]: [Error - 23:28:17.307] Unable to update configuration
atgote commented 1 month ago

So the server requires some initialization options. At least the exceptions above are related to missing telemetryStorage path.

The following initializationOptions worked for me to get server running. However, I've NOT refined them to the minimal working config.

    \   initializationOptions: #{
    \       productKey: 'vscode',
    \       telemetryStorage: '~/vim-playground/telemetry/sonarlint_usage',
    \       productName: 'SonarLint VSCode',
    \       showVerboseLogs: v:true,
    \       platform: 'linux',
    \       architecture: 'x64',
    \       additionalAttributes: #{
    \         vscode: #{
    \           isTelemetryEnabled: v:false,
    \         },
    \       },
    \   }

image

But.. At the moment we have unexpected warning messages from the server.

'/home/---/vim-playground/sonarlint/sonarlint-ls.sh' Language Server Messages
===========================================================================================
06/04/24 10:30:29: [Log]: [Info - 10:30:29.655] SonarLint backend started, instance=org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl@ffaa6af
06/04/24 10:30:29: [Log]: [Debug - 10:30:29.758] Folder WorkspaceFolder[name=cpptest,uri=file:///home/---/vim-playground/cpptest/] added
06/04/24 10:30:29: [Log]: [Debug - 10:30:29.795] Fetching global configuration
06/04/24 10:30:31: [Log]: [Info - 10:30:31.041] Started embedded server on port 64120
06/04/24 10:30:31: [Log]: [Debug - 10:30:31.058] Starting local-only issue database from /home/---/.sonarlint/xodus-local-only-issue-store10212970120631843200
06/04/24 10:30:31: [Log]: [Debug - 10:30:31.486] Fetching configuration for folder 'file:///home/---/vim-playground/cpptest/'
06/04/24 10:30:31: [Log]: [Debug - 10:30:31.492] Workspace folder 'WorkspaceFolder[name=cpptest,uri=file:///home/---/vim-playground/cpptest/]' configuration updated: WorkspaceFolderSettings[analyzerProperties={sonar.cs.file.suffixes=.cs, sonar.cs.internal.loadProjectsTimeout=60, sonar.cs.internal.useNet6=true, sonar.cs.internal.loadProjectOnDemand=false},connectionId=<null>,pathToCompileCommands=./compile_commands.json,projectKey=<null>,testFilePattern=<null>]
06/04/24 10:30:31: [Log]: [Debug - 10:30:31.493] Global settings updated: WorkspaceSettings[connections={},disableTelemetry=false,excludedRules=[],focusOnNewCode=false,includedRules=[],pathToNodeExecutable=<null>,ruleParameters={},showAnalyzerLogs=false,showVerboseLogs=false]
06/04/24 10:37:26: [Log]: [Warn - 10:37:26.345] Illegal state. File "file:///home/---/vim-playground/cpptest/main.cpp" is reported changed but we missed the open notification
06/04/24 10:37:26: [Log]: [Warn - 10:37:26.346] Illegal state: trying to update file that was not open
06/04/24 10:37:26: [Log]: [Warn - 10:37:26.888] Illegal state. File "file:///home/---/vim-playground/cpptest/main.cpp" is reported changed but we missed the open notification
06/04/24 10:37:26: [Log]: [Warn - 10:37:26.888] Illegal state: trying to update file that was not open
06/04/24 10:37:27: [Log]: [Warn - 10:37:27.856] Illegal state. File "file:///home/---/vim-playground/cpptest/main.cpp" is reported changed but we missed the open notification
06/04/24 10:37:27: [Log]: [Warn - 10:37:27.856] Illegal state: trying to update file that was not open

And unsupported messages from the server: image

atgote commented 1 month ago

I've reviewed client (vscode extension) implementation. There is a bunch of custom notifications and requests used by the sonarlint language server (only). Including those highlighted in red in the previous message.

jclsn commented 1 month ago

Meaning it isn't easily possible using the Vim lsp?

jclsn commented 1 month ago

@atgote Sorry, did not see your first message. This actually works and I could successfully load the compile_commands.json. It is not analyzing the file though. Seems like you have to manually tell the server to do that and here some code would be required I think.

atgote commented 1 month ago

@atgote Seems like you have to manually tell the server to do that and here some code would be required I think.

Yes, Some additional functionality should be implemented on top of the existing LSP client to handle the unsupported notifications/messages. Otherwise the server doesn't work.

For example we should respond true on the request message from the server sonarlint/shouldAnalyzeFile (at the screenshot above) in order to tell the server to do its work. But this is not 'common' LSP functionality and it should be implemented like an addon/adapter for the existing client.