Skip to content

fortls.langserver.JSONRPC2Error. Error in using Mordern Fortran with fortls, on remote host using VScode #550

Closed
@l975421700

Description

@l975421700

Dear developers

I meet a problem while using Modern Fortran v3.1.0 in VScode 1.68.0. VScode is run on MacOS, and I am using Modern Fortran on a remote linux server. The problem is that even fortls seems to be initialized successfully, I cannot use most of the functions (e.g. GoTos, Peeks). Can you please help or advise where else I should seek help? Below are detailed information about my set up. If you need more information, please let me know.

Regards, Qinggang

################################ OUTPUT from Modern Fortran in VScode
["INFO" - 4:13:01 PM] Extension Name: Modern Fortran
["INFO" - 4:13:01 PM] Extension Version: 3.1.0
["INFO" - 4:13:01 PM] Linter set to: gfortran
["INFO" - 4:13:01 PM] Formatter set to: findent
["INFO" - 4:13:01 PM] Autocomplete set to: fortls
["INFO" - 4:13:01 PM] Hover set to: fortls
["INFO" - 4:13:01 PM] Symbols set to: fortls
["INFO" - 4:13:01 PM] using linter: gfortran located in: /global/AWIsoft/gcc/8.1.0/bin/gfortran
["INFO" - 4:13:01 PM] Linter.arguments:
-Wall
-ffree-line-length-none
-ffixed-line-length-none
["INFO" - 4:13:01 PM] Linter.include:

["INFO" - 4:13:01 PM] Fortran Language Server
["INFO" - 4:13:01 PM] Initialising Language Server for workspace: /work/ollie/qigao001/model_codes/echam-6.3.05p2-wiso/src/echam/mo_cloud.f90 with command-line options: --enable_code_actions, --hover_signature, --use_signature_help, --nthreads=4, --notify_init, --incremental_sync
[INFO - 16:14:02] fortls - Fortran Language Server 2.9.0 Initialized
[INFO - 16:14:02] fortls initialization complete
[ERRO - 16:14:02] error handling request: {'jsonrpc': '2.0', 'method': 'workspace/didChangeConfiguration', 'params': {'settings': {'fortran': {'provide': {'autocomplete': 'fortls', 'hover': 'fortls', 'symbols': 'fortls'}, 'preferredCase': 'uppercase', 'linter': {'compiler': 'gfortran', 'includePaths': [], 'compilerPath': '', 'extraArgs': [], 'modOutput': ''}, 'formatting': {'formatter': 'findent', 'findentArgs': [], 'fprettifyArgs': [], 'path': ''}, 'fortls': {'path': '/home/ollie/qigao001/.local/bin/fortls', 'configure': '', 'notifyInit': True, 'incrementalSync': True, 'nthreads': 4, 'sortKeywords': False, 'symbolTypes': True, 'suffixes': [], 'directories': [], 'excludeSuffixes': [], 'excludeDirectories': [], 'preprocessor': {'suffixes': [], 'directories': [], 'definitions': {}}, 'disableDiagnostics': False, 'maxLineLength': -1, 'maxCommentLineLength': -1, 'extraArgs': [], 'disableAutoupdate': False, 'disabled': False, 'preserveKeywordOrder': None}, 'includePaths': None, 'gfortranExecutable': None, 'linterEnabled': None, 'linterExtraArgs': None, 'linterModOutput': None, 'provideSymbols': None, 'symbols': None, 'provideHover': None, 'provideCompletion': None}}}}
Traceback (most recent call last):
File "/home/ollie/qigao001/.local/lib/python3.7/site-packages/fortls/langserver.py", line 160, in handle
handler(request)
File "/home/ollie/qigao001/.local/lib/python3.7/site-packages/fortls/langserver.py", line 1488, in serve_default
code=-32601, message=f"method {request['method']} not found"
fortls.langserver.JSONRPC2Error

################################ Info about fortls
$ which fortls
~/.local/bin/fortls
$ fortls --version
2.9.0

I installed fortls with pip before I installed Modern Fortran. I also tried to let Modern Fortran install fortls for me, same errors happen.

################################ Info about VSCode
Version: 1.68.0 (Universal)
Commit: 4af164ea3a06f701fe3e89a2bcbb421d2026b68f
Date: 2022-06-08T11:44:00.250Z (1 wk ago)
Electron: 17.4.7
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Darwin arm64 21.5.0

################################ Info about Mac OS:
macOS Monterey
Version 12.4
Chip Apple M1 Pro

################################ Info about Linux remote server:

uname -a
Linux ollie0 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

And I do not have 'sudo' permission.

################################ VScode settings:
{
"workbench.startupEditor": "newUntitledFile",
"python.dataScience.alwaysTrustNotebooks": true,
"explorer.confirmDelete": false,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"python.languageServer": "Pylance",
"remoteX11.SSH.privateKey": "~/.ssh/id_ed25519",
"remoteX11.SSH.timeout": 30,
"remoteX11.SSH.verboseLogging": true,
"remoteX11.SSH.port": 22,
"explorer.confirmDragAndDrop": false,
"editor.rulers": [
79
],
"kite.showWelcomeNotificationOnStartup": false,
"extensions.ignoreRecommendations": false,
"python.terminal.launchArgs": [
"-c",
""from IPython import start_ipython; start_ipython()"",
"--no-autoindent",
],
"debug.showBreakpointsInOverviewRuler": true,
"remote.SSH.remotePlatform": {
"daint": "linux",
"fog": "linux",
"daint1": "linux",
"fog.ethz.ch": "linux",
"ela": "linux",
"daint2": "linux",
"ivt": "linux",
"jasmin": "linux",
"sci3": "linux",
"sci8": "linux",
"ollie": "linux"
},
"remote.SSH.connectTimeout": 60,
"remote.SSH.useFlock": false,
"files.exclude": {
"/.*": true,
"
/.gitignore": true,
"/.hg": false,
"
/.svn": false,
"/.vscode": true,
"
/bas_palaeoclim": true,
"/bilinear*.nc": true,
"
/cfview": true,
"/CVS": false,
"
/dask-worker-space": true,
"/LICENSE": true,
"
/MetOffice_data_licence.1275844907": true,
"**/miniconda3": true
},
"remote.SSH.remoteServerListenOnSocket": true,
"git.ignoreLegacyWarning": true,
"gitlens.advanced.messages": {
"suppressGitVersionWarning": true
},
"files.associations": {
".rmd": "markdown"
},
"r.bracketedPaste": true,
"r.editor.tabSize": 4,
"r.linting.doubleQuotes": false,
"r.linting.enable": true,
"r.linting.maxLineLength": 79,
"r.dependencyChecks": false,
"editor.largeFileOptimizations": false,
"workbench.activityBar.iconClickBehavior": "focus",
"timeline.excludeSources": [
"git-history"
],
"editor.minimap.enabled": false,
"python.showStartPage": false,
"r.rterm.linux": "/nas/qigao/miniconda3/envs/mobis/bin/radian",
"r.sessionWatcher": true,
"workbench.colorTheme": "Quiet Light",
"settingsSync.ignoredSettings": [
"editor.fontSize",
"debug.console.fontSize",
"markdown.preview.fontSize",
"terminal.integrated.fontSize",
"jupyter.notebookFileRoot",
"fortran.gfortranExecutable",
"editor.wordWrap"
],
"workbench.editorAssociations": {
"
.ipynb": "jupyter-notebook"
},
"[json]": {
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace",
"gitlens.codeLens.scopes": [
"document"
]
},
"editor.fontSize": 18,
"workbench.editor.untitled.hint": "hidden",
"debug.console.fontSize": 18,
"markdown.preview.fontSize": 18,
"update.mode": "none",
"notebook.cellToolbarLocation": {
"default": "right",
"jupyter-notebook": "left"
},
"security.workspace.trust.untrustedFiles": "open",
"[python]": {
"editor.wordBasedSuggestions": false
},
"terminal.integrated.defaultProfile.osx": "bash",
"python.autoComplete.extraPaths": [
"/home/users/qino",
],
"python.analysis.extraPaths": [
"/home/users/qino"
],
"jupyter.askForKernelRestart": false,
"editor.hover.enabled": false,
"terminal.integrated.fontSize": 14,
"scm.inputFontSize": 18,
"notebook.markup.fontSize": 18,
"explorer.autoReveal": false,
"editor.foldingMaximumRegions": 65000,
"editor.wrappingIndent": "indent",
"git.ignoreLimitWarning": true,
"jupyter.magicCommandsAsComments": true,
"terminal.integrated.inheritEnv": false,
"extensions.autoUpdate": false,
"terminal.integrated.scrollback": 100000,
"terminal.integrated.persistentSessionScrollback": 100000,
"files.maxMemoryForLargeFilesMB": 12288,
"editor.accessibilitySupport": "off",
"window.zoomLevel": -1,
"fortran.preferredCase": "uppercase",
"fortran.fortls.path": "/home/ollie/qigao001/.local/bin/fortls",
"editor.wordWrap": "wordWrapColumn",
"fortran.fortls.notifyInit": true,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions