Replies: 4 comments
-
Hi @allcpu
I inherited the auto-completion from the code editor of Microsoft Small Basic and evolved it.
the code of this feature exists in the CompletionProvider.vb file in the LangServices project. The completion items are fetched by the [GetCompletionBag function](https://github.com/VBAndCs/sVB-Small-Visual-Basic/blob/708739ba563a446305fcd825a1e27bb3b8905fb4/LangServices/CompletionProvider.vb#L930), but knowing the correct items is done by the compiler itself ( see the [SBCompiler
/Completion folder](https://github.com/VBAndCs/sVB-Small-Visual-Basic/tree/master/SBCompiler/SBCompiler/Completion) ), because you need to parse the code and get info about every statement, so each statement has a PopulateCompletionItems method (inherited from the Statement base calss) which receives the line and column numbers to get the token exists at this location, hence populate the completion bag with possible completion items related to this position. For example, see the [PopulateCompletionItems method of the assignment statement](https://github.com/VBAndCs/sVB-Small-Visual-Basic/blob/708739ba563a446305fcd825a1e27bb3b8905fb4/SBCompiler/SBCompiler/Statements/AssignmentStatement.vb#L188).
So, to be able to do that, you need to target a compiler that provides you with the syntax tree (the parse tree), and you should be able to get all details about each statement to provide such a PopulateCompletionItems method if the compiler doesn't give a similar method. But if the compiler is closed, you will have to recreate the compiler your self, or fork its source code (if available) to add such functionality. I think most compilers provide similar ways to allow editors to provide auto-completion, but the organization and naming of the methods that do it may be different. You should study the services provided by each compiler, or look at its source code to know more.
By the way, Small Visual Basic is the easiest language for kids. I wrote a book to introduce it to 6 years old kids (not published yet) to prove that it is way easier and productive even than Scratch.
Thanks.
…________________________________
From: allcpu ***@***.***>
Sent: Friday, January 12, 2024 10:55 AM
To: VBAndCs/sVB-Small-Visual-Basic ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [VBAndCs/sVB-Small-Visual-Basic] How did Intelligent code completion of sVB work (Discussion #50)
Hi Sir,
I am really impressed of the IDE you have designed but my aim is not to teach students C# or VB my aim is to teach them Kotlin, Java, Zig, Nim, Rust, Javascript like languages.
I like the way you have made autocompletion of the code and the popup which come after typing.
I want to develop the editor like you have made.
I have completed the designing of the block coding for XML and HTML editing.
But the block coding cant help due to
https://en.m.wikipedia.org/wiki/Deutsch_limit
This is the reason I want to develop editor like you
—
Reply to this email directly, view it on GitHub<#50>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALQ5MVXK7PPAFMYA7WJIIODYOEJBLAVCNFSM6AAAAABBX6BQQ2VHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWGA3DKNZVG4>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Note that an easier alternative is the Language Server Protocol LSP, which many languages implement to provide language services in different code editors. So if any of your desired languages has a language server, you can use an editor that implements a language client for it, or implement a client in your own editor. Use google to find more info about that. I did not use LSP before but I hope I can explore it someday.
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: allcpu ***@***.***>
Sent: Friday, January 12, 2024 12:55:17 PM
To: VBAndCs/sVB-Small-Visual-Basic ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [VBAndCs/sVB-Small-Visual-Basic] How did Intelligent code completion of sVB work (Discussion #50)
Hi Sir,
I am really impressed of the IDE you have designed but my aim is not to teach students C# or VB my aim is to teach them Kotlin, Java, Zig, Nim, Rust, Javascript like languages.
I like the way you have made autocompletion of the code and the popup which come after typing.
I want to develop the editor like you have made.
I have completed the designing of the block coding for XML and HTML editing.
But the block coding cant help due to
https://en.m.wikipedia.org/wiki/Deutsch_limit
This is the reason I want to develop editor like you
—
Reply to this email directly, view it on GitHub<#50>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALQ5MVXK7PPAFMYA7WJIIODYOEJBLAVCNFSM6AAAAABBX6BQQ2VHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWGA3DKNZVG4>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Thankyou Sir but the locic is very hard for me to understand. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I just published the first book of the "Small Visual Basic Kid Programmer" series on Amazon: https://www.amazon.com/dp/B0CVK1BMC9
…________________________________
From: allcpu ***@***.***>
Sent: Friday, January 12, 2024 10:55 AM
To: VBAndCs/sVB-Small-Visual-Basic ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [VBAndCs/sVB-Small-Visual-Basic] How did Intelligent code completion of sVB work (Discussion #50)
Hi Sir,
I am really impressed of the IDE you have designed but my aim is not to teach students C# or VB my aim is to teach them Kotlin, Java, Zig, Nim, Rust, Javascript like languages.
I like the way you have made autocompletion of the code and the popup which come after typing.
I want to develop the editor like you have made.
I have completed the designing of the block coding for XML and HTML editing.
But the block coding cant help due to
https://en.m.wikipedia.org/wiki/Deutsch_limit
This is the reason I want to develop editor like you
—
Reply to this email directly, view it on GitHub<#50>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALQ5MVXK7PPAFMYA7WJIIODYOEJBLAVCNFSM6AAAAABBX6BQQ2VHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWGA3DKNZVG4>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Sir,
I am really impressed of the IDE you have designed but my aim is not to teach students C# or VB my aim is to teach them Kotlin, Java, Zig, Nim, Rust, Javascript like languages.
I like the way you have made autocompletion of the code and the popup which come after typing.
I want to develop the editor like you have made.
I have completed the designing of the block coding for XML and HTML editing.
But the block coding cant help due to
https://en.m.wikipedia.org/wiki/Deutsch_limit
This is the reason I want to develop editor like you
Beta Was this translation helpful? Give feedback.
All reactions