Comments (13)
I noticed that filtering works in some contexts, but not others. It appears to work fine on a method. Typing a 'd' filters down to the keywords "deprecated" and "description". But it doesn't work on a parameter item. Typing a letter just closes the code assist suggestions, instead of filtering it.
from kaizen-openapi-editor.
Making this one high priority. Some users are starting to notice that this doesn't work as expected, and in some cases they have the impression that code assist simply doesn't work.
from kaizen-openapi-editor.
I have looked at this. The problem is that in some cases, the yaml parser fails to parse the content of the document after the user enters a character and invoke content assist. The document becomes invalid while the user enters those new characters.
We need what is returned by the yaml parser to compute the content assist proposals, but in those cases maybe we should allow the proposals provider to use the previous state of the document.
from kaizen-openapi-editor.
As @ghillairet mentioned above this task is more difficult than just filtering a list of strings based on a prefix. We have to deal with a parser results for invalid models. For example, Xtext generates a special lightweight Antlr parser (org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser
) and lexer tailored for content assist.
Finding a right approach for implementation of this feature can take some time.
from kaizen-openapi-editor.
@tfesenko @ghillairet, thanks for the input. I continue to think that this is really important, and we should try to find a way to make it work. I'm quite open to considering some creative solutions for this, if you have any.
from kaizen-openapi-editor.
Not sure if @ghillairet's most recent commit, introducing a unified JSON model, helps with typeahead. But I had a couple of thoughts about this that I wanted to record here, when we're ready to get back to it:
- Could we suspend validation while the code assist UI is displayed? So if the user invokes code assist, starts typing, and introduces a validation error while typing, it shouldn't disrupt the functionality of code assist, which is the user's current focus. There are other typeahead scenarios that this may not address, such as typing a partial string and then invoking code assist; but it would still be a big improvement.
- Can we cache the most recent valid state of the document, and present this when the user invokes code assist? This could address that other case, where the user enters a partial string, which introduces an error, and then invokes code assist. I think this is what Guillaume referred to in this previous comment.
from kaizen-openapi-editor.
@tedepstein Actually I've done something in my latest PR that helps with that issue. (I should update the PR comment I haven't wrote all reasons that made me implement that, but the use of a model is not the reason for that fix)
It is done exactly on that line e0d612d#diff-8bef65b0311b7566e89920c6a04c4972R38 What I do is that I only parse the document until the position of the user's cursor, and remove what he already typed. I found that it makes the content assist work in cases where it didn't before.
from kaizen-openapi-editor.
Note (on task/58 branch):
Typeahead work well at the end of a line:
But it does not work in the middle of a line:
I am not sure if the latter is a common scenario though...
from kaizen-openapi-editor.
Except a limitation noted above (the cursor should be at the very end of the line) I did not notice any issues related to typeahead (all on the task branch).
I submitted several general content-assist bugs, the most important one is #217 "Code-assist for schema properties is incomplete". It's hard to verify typeahead for schema definitions when content-assist shows only generic _key_
proposals...
IMO, the paths
work much better than schema definitions.
from kaizen-openapi-editor.
Typeahead works quite well (with an exception of #217 "Code-assist for schema properties is incomplete").
I found a new bug: code-assist shows code templates that don't start with the provided prefix:
from kaizen-openapi-editor.
@tfesenko wrote:
code-assist shows code templates that don't start with the provided prefix:
I think we could extract that bug to a new issue, which doesn't need to be considered high-priority. @tfesenko , if you agree, please extract it and close this one.
from kaizen-openapi-editor.
@tfesenko , @ghillairet , should we close this issue?
from kaizen-openapi-editor.
I think yes.
from kaizen-openapi-editor.
Related Issues (20)
- Failure running with java 11 HOT 2
- Code assist is missing properties named "default"
- Skip empty strings in formatter (customizable)
- File does not contain a valid swagger spec HOT 2
- Plugin not compatible with Eclipse 2019-06 release? HOT 3
- Memory leak in swagger editor
- YAML References in other files throws warning
- Internal error occurred during: "Update KaiZen Editor validation markers" HOT 4
- Only Swagger v2 features work, not OpenAPI v3 HOT 7
- Error updating Kaizen Editor to version 0.8.0.201909121743 HOT 3
- Unable to close eclipse properly because of Kaizen-OpenAPI-Editor HOT 1
- invalid character in reference
- Spell checker is not working on Swagger file editor HOT 1
- Add "./" for file completion on file $ref
- Doesn't follow the Eclipse Color Theme plugin (so black text on black background is a result of dark theme) HOT 3
- Installation in 2020-12 fails silently
- Avoid warning on inherited properties (allOf)
- description causes failed to match exactly one schema
- Update site returning HTTP status 504 HOT 5
- Update Site is down HOT 3
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 kaizen-openapi-editor.