-
Notifications
You must be signed in to change notification settings - Fork 36
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
Fix #113 + tabs to spaces #114
Conversation
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.
For the style settings what vim settings are you using? I have noexpandtab
(which is vim default) and incosistently I use softtabstop=2
(the default is 0) and shiftwidth=2
). The problem is how the line continuation \
is indented by the default vim indent script. Even with expandtab
I end up with 6 spaces that are inserted. I prefer to stay close to how vim works to avoid manual indentation.
autoload/purescript/ide.vim
Outdated
\ && cwdresp2Decoded.result == a:expectedCWD | ||
call purescript#ide#utils#debug("s:retryFn: success", 1) | ||
call PSCIDEload(1, "") | ||
else | ||
if type(cwdresp2Decoded) == v:t_dict | ||
let error = get(cwdresp2Decoded, "error", []) | ||
if type(error) == v:t_list && len(error) && !silent | ||
call purescript#ide#utils#warn(join(error, " "), v:true) | ||
call purescript#ide#utils#warn(join(error, " "), v:true) |
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.
Could you fix indentation here.
autoload/purescript/ide.vim
Outdated
|
||
if a:isRetry | ||
if !silent | ||
call purescript#ide#utils#log("failed to contact server", v:true) | ||
call purescript#ide#utils#log("failed to contact server", v:true) |
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.
and here as well.
autoload/purescript/ide/import.vim
Outdated
if type(a:resp) != v:t_dict || get(a:resp, "resultType", "error") !=# "success" | ||
if !a:silent && type(a:resp) == v:t_dict | ||
return purescript#ide#utils#log(a:resp["result"]) | ||
return purescript#ide#utils#log(a:resp["result"]) |
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.
and here
autoload/purescript/ide/import.vim
Outdated
@@ -140,16 +140,16 @@ function! s:callback(resp, ident, view, lines, silent, rebuild, ignoreMultiple, | |||
let results = [] | |||
for res in respResults | |||
if empty(filter(copy(results), { idx, val -> val.module == res.module })) | |||
call add(results, res) | |||
call add(results, res) |
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.
and here
autoload/purescript/ide/import.vim
Outdated
endif | ||
endfor | ||
if (len(results) == 1) | ||
let choice = { "option": results[0], "picked": v:true } | ||
else | ||
if !a:ignoreMultiple | ||
let choice = purescript#ide#utils#pickOption("Multiple possibilities to import " . a:ident, results, "module") | ||
let choice = purescript#ide#utils#pickOption("Multiple possibilities to import " . a:ident, results, "module") |
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.
and these two lines too
autoload/purescript/ide/import.vim
Outdated
else | ||
return | ||
return |
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.
and here
ftplugin/purescript_pscide.vim
Outdated
\ a:ident, | ||
\ v:true, | ||
\ { resp -> s:PSCIDEaddTypeAnnotationCallback(a:ident, resp) } | ||
let currentModule = purescript#ide#utils#currentModule() |
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.
Why not just change s:getType
. This will also fix Ptype
command.
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.
How? add to s:getType
new parameter with meaning use currentModule as only filter
?
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.
I think it would be just enough to add the currentModule
to the modules
list here
@coot, I have fixed tabs, nice catch My settings in vim: |
Do you use some plugin for indentation? The default |
@coot I think editorconfig |
As I mentioned, I don't want to manually indent every |
Ah, I got it, before - https://asciinema.org/a/FpwjjbySPPmDMuQblLsHvVkP8 fixed this with |
Thanks! |
#113 is fixed now. |
so i basically copied logic from getType and substituted filters based on imports with only currentModule