Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Added support for user configuration #1079

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

colbyn
Copy link

@colbyn colbyn commented Feb 5, 2019

This is something I added a little while ago and thought others may find this useful (includes a doc file ./docs/hie-yaml-file.md).

The primary feature is to just simply disable interactive (as you type) analysis, as mentioned in the ./docs/hie-yaml-file.md file. For a reference the RLS project has a similar option called build_on_save (https://github.com/rust-lang/rls#configuration).

@Anrock Anrock requested review from lukel97 and alanz February 6, 2019 13:27
Copy link
Collaborator

@lukel97 lukel97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could these options be added to the LSP configuration settings, instead of creating a new file/format?

data Config =
Config
{ hlintOn :: Bool
, maxNumberOfProblems :: Int
, diagnosticsDebounceDuration :: Int
, liquidOn :: Bool
, completionSnippetsOn :: Bool
, formatOnImportOn :: Bool
} deriving (Show,Eq)

@colbyn
Copy link
Author

colbyn commented Feb 23, 2019

Certainly.

I’ve just implemented the necessary changes for using the preexisting settings format, and updated the README.md file. I’m not sure how it’s supposed to work in general. Perhaps it’s editor specific, yet for the life of me I couldn’t figure out how the json value/file is exchanged (from looking at the getConfigFromNotification function)…

So as a workaround if the value isn’t available it defaults to checking for a settings.json file that then defaults to the Default instance, i.e. configVal (onSaveOnly configFile) onSaveOnly >>= \case.

I suppose the name of this branch doesn’t make any sense now. I wasn’t sure what to rename it to so I left it as is.

@alanz
Copy link
Collaborator

alanz commented Feb 24, 2019

@colbyn

The settings.json format is described so that LSP clients can know what options to provide when sending the configuration message through. So strictly speaking managing settings is a client issue, not a server issue.

It is also not clear to my whether the onSaveOnly mechanism is the right one to use for this, the flag makes sense, but I am not sure whether it should rather be implemented via the TextDocumentSyncKind setting for TextDocumentSyncOptions from the server, to switch it from incremental to full.

@lukel97
Copy link
Collaborator

lukel97 commented Feb 25, 2019

@colbyn The settings.json location depends on the client, for LanguageClient-neovim it should be in .vim/settings.json. For VS Code you need to expose it via the extension, which is done in javascript. I recently created a PR to add a new option to it here

@alanz alanz modified the milestones: 2019-02, 2019-03 Mar 2, 2019
@alanz alanz modified the milestones: 2019-03, 2019-04 Apr 6, 2019
@alanz alanz modified the milestones: 2019-04, 2019-05 May 4, 2019
@alanz alanz modified the milestones: 2019-05, 2019-06 Jun 1, 2019
@alanz alanz modified the milestones: 2019-06, Some time Jul 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants