dragos / dragos-vscode-scala

Other
253 stars 39 forks source link

"Unknown configuration settings" warnings from VSCode (cosmetic?) #70

Closed Blaisorblade closed 6 years ago

Blaisorblade commented 6 years ago

Disclaimer: I haven't read many docs beyond this project's README. However, it was mostly not needed—I had a few minor issues, all fixed through restarts/cleaning caches.

TL;DR. It seems this plugin should declare scalaLanguageServer.logLevel and scalaLanguageServer.heapSize to VSCode but doesn't, so VSCode warns about those settings with "Unknown configuration setting", even though they work fine.

Details

I added the following content in my settings, based on tooltips and this plugin's docs:

{
    "vim.enableNeovim": false,
    "vim.disableAnnoyingNeovimMessage": true,
    "scalaLanguageServer.logLevel" : "DEBUG",
    "scalaLanguageServer.heapSize" : "768M"
}

However, the two latter settings (either in the user settings or workspace settings) give warnings such as:

file: 'file:///Users/pgiarrusso/Library/Application%20Support/Code/User/settings.json'
severity: 'Warning'
message: 'Unknown configuration setting'
at: '4,5'
source: ''

Googling only found the same warning for other plugins. Browsing VSCode docs suggests available config settings should be declared following this example: https://code.visualstudio.com/docs/extensionAPI/extension-points

I don't really understand the current configuration, but it seems to indeed not declare those settings.

It seems the setting might still work—jps finds (among others) these running JVMs, and I suspect the latter has vscode.logLevel=DEBUG because of my setting. The former seems an instance of #2 (I also got errors on locks being held, worked around by moving away the Ensime cache).

91013 coursier -Xmx768M -Dvscode.workspace=/Users/pgiarrusso/AeroFS/Repos/trying-sbt-1 -Dvscode.logLevel=undefined
95484 coursier -Xmx768M -Dvscode.workspace=/Users/pgiarrusso/AeroFS/Repos/trying-sbt-1 -Dvscode.logLevel=DEBUG

Indeed, changing those settings, closing the folder and reopening it leads to the following JVMs:

91013 coursier -Xmx768M -Dvscode.workspace=/Users/pgiarrusso/AeroFS/Repos/trying-sbt-1 -Dvscode.logLevel=undefined
96701 coursier -Xmx1024M -Dvscode.workspace=/Users/pgiarrusso/AeroFS/Repos/trying-sbt-1 -Dvscode.logLevel=INFO

Where the settings for PID 96701 are the ones I specified.

dragos commented 6 years ago

Thanks for the detailed report, you are right.

xuebingli commented 6 years ago

@dragos if you're busy, I'm happy to put up a PR. The fix seems easy enough.

dragos commented 6 years ago

That would be great, thank you!