Comments (4)
I think I have it in 3fb5f18
from purescript-language-server.
I think this happens in the following combination:
There's both an unnecessary import for a data constructor and some unused functions on the same line ((..)
and fromMaybe
are unnecessary in this example):
import Data.Maybe (Maybe(..), fromMaybe)
example :: Maybe String -> Maybe String
example = identity
🔝 breaks.
When they occur in isolation it works (only fromMaybe
is redundant here):
import Data.Maybe (Maybe(..), fromMaybe)
import PscIdeClient (compileCode)
example :: Maybe String -> Maybe String
example _ = Just ""
as well as (only (..)
is redundant here)
import Data.Maybe (Maybe(..), fromMaybe)
example :: Maybe String -> Maybe String
example = identity
example2 = fromMaybe
work.
from purescript-language-server.
After more investigation something surprising happens for the first example when specifying: "Apply suggestion" on the line in question. It does what it should and leaves us with:
import Data.Maybe (Maybe)
the same is true for "Remove unused reference". It also produces the complete correct result.
from purescript-language-server.
PR #78 fixes this case for me, but the following fails:
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Maybe (Maybe(..), fromMaybe)
example :: Maybe String -> Maybe String
example = identity
I think this is just due to overlaps being prohibited, in this case they are still present due to not being simple duplicates. It's clear in the LSP spec that overlaps are not permitted, but I think either earlier versions of vscode allowed this or the other form of edit in the earlier LSP spec did so.
from purescript-language-server.
Related Issues (20)
- Support configuring spago file/target
- Neovim configuration HOT 6
- BUG: Deleting/renaming modules does NOT purge them from the cache HOT 3
- Support completion for qualified do imports
- Docs: Update formatter section HOT 1
- Organizeing imports deletes comments HOT 1
- Hover (show documentation) does not work with recent coc.nvim HOT 8
- Suggestion: Extend diagnostics on type to buffer switches HOT 1
- Support multiple spans per diagnostic
- Incorrect "Go to definition" behavior for the `Bind` data type.
- E715: Dictionary required when trying to apply sourse.sortImports code action HOT 2
- Breakpoints?
- Use with spaghetto (spago@next)
- amazing stuff; just wondering if it supports eval? like in -- >> HOT 1
- Warning/Error reporting not working? HOT 5
- Action to export HOT 1
- Find references returns no references HOT 1
- Should optional field return null? HOT 1
- Stale errors/warnings stick around after a full build
- Presence of VTA prevents LSP functionality
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from purescript-language-server.