-
-
Notifications
You must be signed in to change notification settings - Fork 388
Add PluginId
to CommandFunction
& make getNormalizedFilePath
takes Uri
as pram instead of TextDocumentIdentifier
#2906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -30,10 +30,10 @@ import System.Posix.Signals | |||||||||||||||||||||||||||||||||||||
#endif | ||||||||||||||||||||||||||||||||||||||
import Control.Lens ((^.)) | ||||||||||||||||||||||||||||||||||||||
import Data.Aeson hiding (defaultOptions) | ||||||||||||||||||||||||||||||||||||||
import qualified Data.DList as DList | ||||||||||||||||||||||||||||||||||||||
import qualified Data.Default | ||||||||||||||||||||||||||||||||||||||
import Data.Dependent.Map (DMap) | ||||||||||||||||||||||||||||||||||||||
import qualified Data.Dependent.Map as DMap | ||||||||||||||||||||||||||||||||||||||
import qualified Data.DList as DList | ||||||||||||||||||||||||||||||||||||||
import Data.GADT.Compare | ||||||||||||||||||||||||||||||||||||||
import Data.List.NonEmpty (NonEmpty (..), toList) | ||||||||||||||||||||||||||||||||||||||
import qualified Data.Map as Map | ||||||||||||||||||||||||||||||||||||||
|
@@ -389,6 +389,7 @@ data PluginCommand ideState = forall a. (FromJSON a) => | |||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
type CommandFunction ideState a | ||||||||||||||||||||||||||||||||||||||
= ideState | ||||||||||||||||||||||||||||||||||||||
-> PluginId | ||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure this is an improvement. The other arguments to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Plus, most of the existing ones don't use it, so we've also added a bunch of unused parameters... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only the command parameter is needed to be passed, I think Here are the stat about the usage of 8/11 use ideState, 3/11 use PluginId, and most of plugins don't use
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I may add, like I mentioned earlier I want to clean up all of the duplicate code revolving around MaybeT. So I would plan on removing the MaybeT wrappers. It may end up being more daunting but I expect to need to use some sort of identifier to use in logging messages. This would also extend to other commonly requested items as well. So it would be nice to have some generic identifier to pass around. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH I also think it looks like we shouldn't pass I think my argument is that it's unclear what should be part of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think my changes have covered all usage of
I believe
Agree with this. As I said earlier, I'm going to close this and open a new pr to make getNormalizedFilePath takes Uri as pram instead of TextDocumentIdentifier only. |
||||||||||||||||||||||||||||||||||||||
-> a | ||||||||||||||||||||||||||||||||||||||
-> LspM Config (Either ResponseError Value) | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed much clear and easy to use, I saw many codes can use uri directly instead of
TextDocumentIdentifier
.🎉