valentjn / vscode-ltex

LTeX: Grammar/spell checker :mag::heavy_check_mark: for VS Code using LanguageTool with support for LaTeX :mortar_board:, Markdown :pencil:, and others
https://valentjn.github.io/ltex
Mozilla Public License 2.0
800 stars 27 forks source link

Ltex invokes multiple java processes #799

Open toooonyy opened 1 year ago

toooonyy commented 1 year ago

Describe the bug Maybe related to https://github.com/valentjn/vscode-ltex/issues/325, now reappeared.

Screen Shot 2023-02-01 at 16 25 44

Steps to reproduce Steps to reproduce the behavior:

  1. Open a tex file with vscode.
  2. Quit, either via right-click menu or cmd+q
  3. Reopen tex file.

Expected behavior terminate java process when closing.

LTeX configuration Reproducible with default config.

"LTeX Language Server" log file

``` [Info - 4:31:56 PM] Starting ltex-ls... Feb 01, 2023 4:31:58 PM org.bsplines.ltexls.server.LtexLanguageServer initialize INFO: ltex-ls 15.2.0 - initializing... Feb 01, 2023 4:31:58 PM org.bsplines.ltexls.tools.I18n setLocale INFO: Setting locale to 'en' Feb 01, 2023 4:31:58 PM org.bsplines.ltexls.settings.SettingsManager$Companion logDifferentSettings FINE: Reinitializing LanguageTool due to different settings for language 'en-GB': setting 'settings', old 'null', new 'non-null' Feb 01, 2023 4:31:59 PM org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FINE: Checking the following text in language 'en-GB' via LanguageTool: "" Feb 01, 2023 4:31:59 PM org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FINE: Obtained 0 rule matches ```

"LTeX Language Client" log file

``` 2023-02-01T15:31:55.610Z Info: Setting LTeX UI language to 'en-us'. 2023-02-01T15:31:55.610Z Info: Loading i18n messages... 2023-02-01T15:31:55.611Z Info: Loading default i18n messages... 2023-02-01T15:31:55.612Z Info: 2023-02-01T15:31:55.612Z Info: ltex.ltex-ls.path not set. 2023-02-01T15:31:55.612Z Info: Searching for ltex-ls in '/Users/tonyy/.vscode/extensions/valentjn.vscode-ltex-13.1.0/lib'... 2023-02-01T15:31:55.613Z Info: ltex-ls found in '/Users/tonyy/.vscode/extensions/valentjn.vscode-ltex-13.1.0/lib/ltex-ls-15.2.0'. 2023-02-01T15:31:55.613Z Info: 2023-02-01T15:31:55.613Z Info: Using ltex-ls from '/Users/tonyy/.vscode/extensions/valentjn.vscode-ltex-13.1.0/lib/ltex-ls-15.2.0'. 2023-02-01T15:31:55.613Z Info: Using Java from '/Users/tonyy/Documents/MC/adop/Contents/Home' (set in ltex.java.path). 2023-02-01T15:31:55.617Z Info: Testing ltex-ls... 2023-02-01T15:31:55.617Z Info: Command: "/Users/tonyy/.vscode/extensions/valentjn.vscode-ltex-13.1.0/lib/ltex-ls-15.2.0/bin/ltex-ls" 2023-02-01T15:31:55.617Z Info: Arguments: ["--version"] 2023-02-01T15:31:55.617Z Info: env['JAVA_HOME']: "/Users/tonyy/Documents/MC/adop/Contents/Home" 2023-02-01T15:31:55.617Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m" 2023-02-01T15:31:56.203Z Info: Test successful! 2023-02-01T15:31:56.204Z Info: 2023-02-01T15:31:56.207Z Info: Starting ltex-ls... 2023-02-01T15:31:56.207Z Info: Command: "/Users/tonyy/.vscode/extensions/valentjn.vscode-ltex-13.1.0/lib/ltex-ls-15.2.0/bin/ltex-ls" 2023-02-01T15:31:56.207Z Info: Arguments: [] 2023-02-01T15:31:56.207Z Info: env['JAVA_HOME']: "/Users/tonyy/Documents/MC/adop/Contents/Home" 2023-02-01T15:31:56.207Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m" 2023-02-01T15:31:56.207Z Info: [Trace - 4:31:56 PM] Sending request 'initialize - (0)'. Params: { "processId": 42706, "clientInfo": { "name": "Visual Studio Code", "version": "1.74.3" }, "locale": "en-us", "rootPath": null, "rootUri": null, "capabilities": { "workspace": { "applyEdit": true, "workspaceEdit": { "documentChanges": true, "resourceOperations": [ "create", "rename", "delete" ], "failureHandling": "textOnlyTransactional", "normalizesLineEndings": true, "changeAnnotationSupport": { "groupsOnLabel": true } }, "didChangeConfiguration": { "dynamicRegistration": true }, "didChangeWatchedFiles": { "dynamicRegistration": true }, "symbol": { "dynamicRegistration": true, "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, 26 ] }, "tagSupport": { "valueSet": [ 1 ] } }, "codeLens": { "refreshSupport": true }, "executeCommand": { "dynamicRegistration": true }, "configuration": true, "workspaceFolders": true, "semanticTokens": { "refreshSupport": true }, "fileOperations": { "dynamicRegistration": true, "didCreate": true, "didRename": true, "didDelete": true, "willCreate": true, "willRename": true, "willDelete": true } }, "textDocument": { "publishDiagnostics": { "relatedInformation": true, "versionSupport": false, "tagSupport": { "valueSet": [ 1, 2 ] }, "codeDescriptionSupport": true, "dataSupport": true }, "synchronization": { "dynamicRegistration": true, "willSave": true, "willSaveWaitUntil": true, "didSave": true }, "completion": { "dynamicRegistration": true, "contextSupport": true, "completionItem": { "snippetSupport": true, "commitCharactersSupport": true, "documentationFormat": [ "markdown", "plaintext" ], "deprecatedSupport": true, "preselectSupport": true, "tagSupport": { "valueSet": [ 1 ] }, "insertReplaceSupport": true, "resolveSupport": { "properties": [ "documentation", "detail", "additionalTextEdits" ] }, "insertTextModeSupport": { "valueSet": [ 1, 2 ] } }, "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 ] } }, "hover": { "dynamicRegistration": true, "contentFormat": [ "markdown", "plaintext" ] }, "signatureHelp": { "dynamicRegistration": true, "signatureInformation": { "documentationFormat": [ "markdown", "plaintext" ], "parameterInformation": { "labelOffsetSupport": true }, "activeParameterSupport": true }, "contextSupport": true }, "definition": { "dynamicRegistration": true, "linkSupport": true }, "references": { "dynamicRegistration": true }, "documentHighlight": { "dynamicRegistration": true }, "documentSymbol": { "dynamicRegistration": true, "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, 26 ] }, "hierarchicalDocumentSymbolSupport": true, "tagSupport": { "valueSet": [ 1 ] }, "labelSupport": true }, "codeAction": { "dynamicRegistration": true, "isPreferredSupport": true, "disabledSupport": true, "dataSupport": true, "resolveSupport": { "properties": [ "edit" ] }, "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" ] } }, "honorsChangeAnnotations": false }, "codeLens": { "dynamicRegistration": true }, "formatting": { "dynamicRegistration": true }, "rangeFormatting": { "dynamicRegistration": true }, "onTypeFormatting": { "dynamicRegistration": true }, "rename": { "dynamicRegistration": true, "prepareSupport": true, "prepareSupportDefaultBehavior": 1, "honorsChangeAnnotations": true }, "documentLink": { "dynamicRegistration": true, "tooltipSupport": true }, "typeDefinition": { "dynamicRegistration": true, "linkSupport": true }, "implementation": { "dynamicRegistration": true, "linkSupport": true }, "colorProvider": { "dynamicRegistration": true }, "foldingRange": { "dynamicRegistration": true, "rangeLimit": 5000, "lineFoldingOnly": true }, "declaration": { "dynamicRegistration": true, "linkSupport": true }, "selectionRange": { "dynamicRegistration": true }, "callHierarchy": { "dynamicRegistration": true }, "semanticTokens": { "dynamicRegistration": true, "tokenTypes": [ "namespace", "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" ], "requests": { "range": true, "full": { "delta": true } }, "multilineTokenSupport": false, "overlappingTokenSupport": false }, "linkedEditingRange": { "dynamicRegistration": true } }, "window": { "showMessage": { "messageActionItem": { "additionalPropertiesSupport": true } }, "showDocument": { "support": true }, "workDoneProgress": true }, "general": { "regularExpressions": { "engine": "ECMAScript", "version": "ES2020" }, "markdown": { "parser": "marked", "version": "1.1.0" } } }, "initializationOptions": { "locale": "en", "customCapabilities": { "workspaceSpecificConfiguration": true } }, "trace": "verbose", "workspaceFolders": null } [Trace - 4:31:58 PM] Received response 'initialize - (0)' in 2751ms. Result: { "capabilities": { "textDocumentSync": 1, "completionProvider": {}, "codeActionProvider": { "codeActionKinds": [ "quickfix.ltex.acceptSuggestions" ] }, "executeCommandProvider": { "commands": [ "_ltex.checkDocument", "_ltex.getServerStatus" ] } } } [Trace - 4:31:58 PM] Sending notification 'initialized'. Params: {} [Trace - 4:31:58 PM] Sending notification 'workspace/didChangeConfiguration'. Params: { "settings": { "ltex": { "enabled": [ "bibtex", "context", "context.tex", "html", "latex", "markdown", "org", "restructuredtext", "rsweave" ], "language": "en-GB", "dictionary": {}, "disabledRules": {}, "enabledRules": {}, "hiddenFalsePositives": {}, "bibtex": { "fields": {} }, "latex": { "commands": {}, "environments": {} }, "markdown": { "nodes": {} }, "configurationTarget": { "dictionary": "workspaceFolderExternalFile", "disabledRules": "workspaceFolderExternalFile", "hiddenFalsePositives": "workspaceFolderExternalFile" }, "additionalRules": { "enablePickyRules": false, "motherTongue": "en-GB", "languageModel": "", "neuralNetworkModel": "", "word2VecModel": "" }, "languageToolHttpServerUri": "", "languageToolOrg": { "username": "", "apiKey": "" }, "ltex-ls": { "path": "", "logLevel": "fine", "languageToolHttpServerUri": "", "languageToolOrgUsername": "", "languageToolOrgApiKey": "" }, "java": { "path": "/Users/tonyy/Documents/MC/adop/Contents/Home", "initialHeapSize": 64, "maximumHeapSize": 512 }, "sentenceCacheSize": 2000, "completionEnabled": true, "diagnosticSeverity": "information", "checkFrequency": "edit", "clearDiagnosticsWhenClosingFile": true, "statusBarItem": false, "trace": { "server": "verbose" } } } } [Trace - 4:31:58 PM] Sending notification 'textDocument/didOpen'. Params: { "textDocument": { "uri": "file:///Users/tonyy/Developer/1.tex", "languageId": "latex", "version": 1, "text": "" } } [Trace - 4:31:58 PM] Received request 'window/workDoneProgress/create - (1)'. Params: { "token": "{\"uri\":\"file:///Users/tonyy/Developer/1.tex\",\"operation\":\"checkDocument\",\"uuid\":\"498de32a-a3c6-cced-7b8d-0d1a09f67458\"}" } [Trace - 4:31:58 PM] Sending response 'window/workDoneProgress/create - (1)'. Processing request took 0ms No result returned. [Trace - 4:31:58 PM] Received notification '$/progress'. Params: { "token": "{\"uri\":\"file:///Users/tonyy/Developer/1.tex\",\"operation\":\"checkDocument\",\"uuid\":\"498de32a-a3c6-cced-7b8d-0d1a09f67458\"}", "value": { "kind": "begin", "title": "Checking document", "cancellable": false, "message": "file:///Users/tonyy/Developer/1.tex" } } [Trace - 4:31:58 PM] Received request 'workspace/configuration - (2)'. Params: { "items": [ { "scopeUri": "file:///Users/tonyy/Developer/1.tex", "section": "ltex" } ] } [Trace - 4:31:58 PM] Sending response 'workspace/configuration - (2)'. Processing request took 0ms Result: [ { "enabled": [ "bibtex", "context", "context.tex", "html", "latex", "markdown", "org", "restructuredtext", "rsweave" ], "language": "en-GB", "dictionary": {}, "disabledRules": {}, "enabledRules": {}, "hiddenFalsePositives": {}, "bibtex": { "fields": {} }, "latex": { "commands": {}, "environments": {} }, "markdown": { "nodes": {} }, "configurationTarget": { "dictionary": "workspaceFolderExternalFile", "disabledRules": "workspaceFolderExternalFile", "hiddenFalsePositives": "workspaceFolderExternalFile" }, "additionalRules": { "enablePickyRules": false, "motherTongue": "en-GB", "languageModel": "", "neuralNetworkModel": "", "word2VecModel": "" }, "languageToolHttpServerUri": "", "languageToolOrg": { "username": "", "apiKey": "" }, "ltex-ls": { "path": "", "logLevel": "fine", "languageToolHttpServerUri": "", "languageToolOrgUsername": "", "languageToolOrgApiKey": "" }, "java": { "path": "/Users/tonyy/Documents/MC/adop/Contents/Home", "initialHeapSize": 64, "maximumHeapSize": 512 }, "sentenceCacheSize": 2000, "completionEnabled": true, "diagnosticSeverity": "information", "checkFrequency": "edit", "clearDiagnosticsWhenClosingFile": true, "statusBarItem": false, "trace": { "server": "verbose" } } ] [Trace - 4:31:58 PM] Received request 'ltex/workspaceSpecificConfiguration - (3)'. Params: { "items": [ { "scopeUri": "file:///Users/tonyy/Developer/1.tex", "section": "ltex" } ] } 2023-02-01T15:31:58.975Z Info: Started watching external setting file '/Users/tonyy/Library/Application Support/Code/User/globalStorage/valentjn.vscode-ltex/ltex.dictionary.en-US.txt'. [Trace - 4:31:58 PM] Sending response 'ltex/workspaceSpecificConfiguration - (3)'. Processing request took 12ms Result: [ { "dictionary": { "auto": [], "ar": [], "ast-ES": [], "be-BY": [], "br-FR": [], "ca-ES": [], "ca-ES-valencia": [], "da-DK": [], "de": [], "de-AT": [], "de-CH": [], "de-DE": [], "de-DE-x-simple-language": [], "el-GR": [], "en": [], "en-AU": [], "en-CA": [], "en-GB": [], "en-NZ": [], "en-US": [ "covariation", "liquidly", "programme" ], "en-ZA": [], "eo": [], "es": [], "es-AR": [], "fa": [], "fr": [], "ga-IE": [], "gl-ES": [], "it": [], "ja-JP": [], "km-KH": [], "nl": [], "nl-BE": [], "pl-PL": [], "pt": [], "pt-AO": [], "pt-BR": [], "pt-MZ": [], "pt-PT": [], "ro-RO": [], "ru-RU": [], "sk-SK": [], "sl-SI": [], "sv": [], "ta-IN": [], "tl-PH": [], "uk-UA": [], "zh-CN": [] }, "disabledRules": { "auto": [], "ar": [], "ast-ES": [], "be-BY": [], "br-FR": [], "ca-ES": [], "ca-ES-valencia": [], "da-DK": [], "de": [], "de-AT": [], "de-CH": [], "de-DE": [], "de-DE-x-simple-language": [], "el-GR": [], "en": [], "en-AU": [], "en-CA": [], "en-GB": [], "en-NZ": [], "en-US": [], "en-ZA": [], "eo": [], "es": [], "es-AR": [], "fa": [], "fr": [], "ga-IE": [], "gl-ES": [], "it": [], "ja-JP": [], "km-KH": [], "nl": [], "nl-BE": [], "pl-PL": [], "pt": [], "pt-AO": [], "pt-BR": [], "pt-MZ": [], "pt-PT": [], "ro-RO": [], "ru-RU": [], "sk-SK": [], "sl-SI": [], "sv": [], "ta-IN": [], "tl-PH": [], "uk-UA": [], "zh-CN": [] }, "enabledRules": { "auto": [], "ar": [], "ast-ES": [], "be-BY": [], "br-FR": [], "ca-ES": [], "ca-ES-valencia": [], "da-DK": [], "de": [], "de-AT": [], "de-CH": [], "de-DE": [], "de-DE-x-simple-language": [], "el-GR": [], "en": [], "en-AU": [], "en-CA": [], "en-GB": [], "en-NZ": [], "en-US": [], "en-ZA": [], "eo": [], "es": [], "es-AR": [], "fa": [], "fr": [], "ga-IE": [], "gl-ES": [], "it": [], "ja-JP": [], "km-KH": [], "nl": [], "nl-BE": [], "pl-PL": [], "pt": [], "pt-AO": [], "pt-BR": [], "pt-MZ": [], "pt-PT": [], "ro-RO": [], "ru-RU": [], "sk-SK": [], "sl-SI": [], "sv": [], "ta-IN": [], "tl-PH": [], "uk-UA": [], "zh-CN": [] }, "hiddenFalsePositives": { "auto": [], "ar": [], "ast-ES": [], "be-BY": [], "br-FR": [], "ca-ES": [], "ca-ES-valencia": [], "da-DK": [], "de": [], "de-AT": [], "de-CH": [], "de-DE": [], "de-DE-x-simple-language": [], "el-GR": [], "en": [], "en-AU": [], "en-CA": [], "en-GB": [], "en-NZ": [], "en-US": [], "en-ZA": [], "eo": [], "es": [], "es-AR": [], "fa": [], "fr": [], "ga-IE": [], "gl-ES": [], "it": [], "ja-JP": [], "km-KH": [], "nl": [], "nl-BE": [], "pl-PL": [], "pt": [], "pt-AO": [], "pt-BR": [], "pt-MZ": [], "pt-PT": [], "ro-RO": [], "ru-RU": [], "sk-SK": [], "sl-SI": [], "sv": [], "ta-IN": [], "tl-PH": [], "uk-UA": [], "zh-CN": [] } } ] [Trace - 4:31:59 PM] Received notification '$/progress'. Params: { "token": "{\"uri\":\"file:///Users/tonyy/Developer/1.tex\",\"operation\":\"checkDocument\",\"uuid\":\"498de32a-a3c6-cced-7b8d-0d1a09f67458\"}", "value": { "kind": "end" } } [Trace - 4:31:59 PM] Received notification 'textDocument/publishDiagnostics'. Params: { "uri": "file:///Users/tonyy/Developer/1.tex", "diagnostics": [] } ```

Version information List here the version information of the relevant software.

pmbrandao commented 1 year ago

Similar behaviour found. Every time I open a new VSCode windows (can be by invoking code or doing New window) and open a file handled by Ltex a new java process is started.

Closing VScode's windows does not terminate all java processes started.

Version information

linusheck commented 1 year ago

I have the same issue, just found 20GB of swap occupied with Java processes

j-lakeman commented 1 year ago

Can confirm. Could be related to #497

deividrvale commented 1 year ago

Can confirm as well. I had 5 java processes floating around. Specially that I never turn my computer off, so those might have been there for days.

fdamore95 commented 11 months ago

Same here: Screenshot from 2023-10-27 16-46-12

Hecatron commented 10 months ago

I'm noticing after opening vscode with a markdown file ltex is leaving stray processes open on windows 10 after vscode is closed every time now

image