Comments (4)
So I don't think Conjure is providing any completions for Janet whatsoever, it's just not implemented in the client. Which means that it's falling through to syntaxcomplete which means you're getting the various constants defined in the Janet Vim syntax file provided by Neovim, not Conjure.
Here's a peek at what that omnifunc config value is used for, it's called from the on-filetype
callback which is triggered when we enter a supported filetype, in this case, Janet.
(let [fn-name (config.get-in [:completion :omnifunc])]
(when fn-name
(nvim.ex.setlocal (.. "omnifunc=" fn-name))))
So we read that omnifunc value then set the buffer local omnifunc
value to that function name. You can read more about syntaxcomplete in :help ft-syntax-omni
.
The default omnicomplete fn we use in Conjure (which is probably where your issue is coming from!) is this:
(defn omnifunc [find-start? base]
(if find-start?
(let [[row col] (nvim.win_get_cursor 0)
[line] (nvim.buf_get_lines 0 (a.dec row) row false)]
(- col
(a.count (nvim.fn.matchstr
(string.sub line 1 col)
"\\k\\+$"))))
(eval.completions-sync base)))
That chain of calls under eval.completions-sync
eventually calls through to the following code if the client doesn't support completion.
(-?> (config.get-in [:completion :fallback])
(nvim.call_function [0 prefix]))
SO, my theory is that when we call syntaxcomplete#Complete
inside this nvim.call_function
line we end up losing some important context data surrounding the cursor which leads it to just show you ALL possible values it can suggest. When we correctly trigger it through omnicomplete directly (as you're doing with your config change) that data is preserved so the function executes with the correct context.
So this isn't an answer, yet, but it's the investigation and explanation of the issue I think. I'll see if I can fix it now, although I'm on a train to run a half marathon, so my commitment is patchy this weekend 😅
from conjure.
Huh, interestingly we're passing the right text into the completion fn, it just returns ALL results
(a.println "==="
prefix
(a.count (-?> (config.get-in [:completion :fallback])
(nvim.call_function [0 prefix]))))
;; => === pri 785
from conjure.
Looking through this omnifunc we're trying to use, it's actually quite stateful between calls (I think?)
https://github.com/vim-scripts/SyntaxComplete/blob/master/plugin/syntaxcomplete.vim
It has a bunch of script local (s:...
) variables that it seems to update depending on if you're calling it with the first "find start" flag set to true or not. (yeah, there's a boolean flag that completely changes the behaviour of omnifuncs, it's... interesting)
Which means maybe we have to call it in a certain pattern to get it to behave as expected. I can't find that pattern right now though. Maybe we default Julia's omnifunc to this, but I would like to find the right way to keep the current behaviour because although what you suggest should work in theory, it has tradeoffs and might be tricky to implement.
The logic for configuring omnifuncs is ABOVE the client layer where we get to customise this sort of thing. The clients themselves don't get to decide if their completion fn is called or not. So to change the default behaviour for a client we'd need something bespoke that reaches out of the clear cut concerns the client modules give us.
from conjure.
Thank you for looking into it! Good luck with your half marathon!
from conjure.
Related Issues (20)
- Clojure: evaluate word misinterprets single-quotes in symbol names HOT 6
- [Clojure]: A way to configure a default namespace HOT 6
- Swap `__name__` to something other than `__main__` in Python REPLs HOT 3
- README Suggestion HOT 2
- Cannot connect to Scheme through socket HOT 2
- Async/await doesn't work with ipython REPL HOT 13
- stdio repl handling of both stderr and stdout for a form can be a problem sometimes HOT 1
- <localleader>ee, <localleader>E evaluate the whole file HOT 9
- Problems with evaluation: wrong returns HOT 3
- Guile over nREPL, guile-ares-rs integration HOT 4
- Clojure Debugger: Evaluation failing on debug reader tags HOT 4
- Local leader key not active when open scm files HOT 7
- Common-Lisp: Only first expression is evaluated using ConjureEvalBuf HOT 19
- Feature request: Re-run last test HOT 2
- Common Lisp/ros/swank not behaving as expected HOT 15
- No syntax highlighting in log buffer when opening file using telescope. HOT 7
- HUD not popping up when using AstroVim HOT 3
- Adapt `IRust` support HOT 5
- Hy client not showing output HOT 5
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 conjure.