Repository navigation
Setting the syntax wont be overwritten by :write - #1443
Conversation
fischerling
left a comment
There was a problem hiding this comment.
I highly appreciate those changes, because the current behavior of setting syntax unconditionally on write is really annoying.
However I dislike the type annotation convention used.
But my personal taste is not enough to reject this.
Additionally, I see no reason why we shouldn't export the theme as vis.theme.
|
Frankly I'm not too fond of it, but it does force me to annotate the
function completely and if a parameter changes I cannot ignore it like I do
with ldoc. But I will change it so its suited to vis style.
EDIT: Last time I use email.
|
rnpnr
left a comment
There was a problem hiding this comment.
I'm fine with everything here in general but maybe keep the vis.theme stuff out. It should probably go to vis.options.theme but if there is some issue preventing that then it should wait until that is fixed.
Yes, you cannot set/use .options.theme, then vis.theme shall be removed? |
I see your point. But, this annotation is not recognized by the lua language server. This is the hover I get for the Using an LDoc comment I get this: |
75cdeac to
59eba0d
Compare
|
LGTM. Will merge it tomorrow if @rnpnr has nothing against it. |
|
I'll squash some commits for less history but it should all be functionally the same. |
Move ignoresuffixes table down unify L in one spot detect in 2 lines (aesthetic change)
luacheckrc: add _G.lpeg vis.lua: sets _G.lpeg filetype: aesthetic change
I figured out what kind of type annotations lua-languauge-server supports: --- Some function
---@param string foo some parameter
local function bar(foo)
return foo
endThis annotation does result in a proper Hover message: |
|
@fischerling interestingly, ldoc supports having comments on the parameters like I was already doing, the return still needs I also have 4 more PRs planned from my development branch https://github.com/Nomarian/vis/tree/dev/lua |
See each commit for info, they're all mostly aesthetic changes
A couple of keys added, file.syntax which holds the syntax, basically what Detect() returns
file.basename, which holds the... basename of the file, this is used because the :new :w file.ext is currently running on each :w, which means if you :set syntax to something else its gonna immediately reset it back to whatever it detects.
Also added a vis.theme because... well I don't know why there isn't, there should be a vis.theme