Disable individual autocompletes in Atom - autocomplete

I'm using Github's Atom and while writing go, I get this:
which autocompletes to:
package func main() {
}
which is not legal Go.
I can just press space or undo it after it gets autocompleted, but is it possible to disable individual autocompletes in Atom's Autocompletion engine?

Autocomplete as you have described is in called Snippets in GitHub's Atom parlance. At the time of writing, disabling snippets introduced by either core or community packages is not supported, there is however a enhancement ticket to provide support in the Snippets package.
As an alternative you could follow the instructions in the Atom Flight Manual to override the main snippet with a snippet that was either valid Go, something that might not be possible or simply a snippet that replaces the word main with main, simply add the following to your personal snippets.cson which can be accessed from File -> Snippets...:
'.source.go':
'Main':
'prefix': 'main'
'body': 'main'
At best it's a hack but it does prevent the main Snippet from expanding when you don't want it to.

Related

how to specify what's considered an error, so that I can get squiggly lines

I'm programming in C, and often times I see myself forgetting to type the '&' when using scanf. I've used replit in the past and there, in that case the variable gets a squiggly underline showing it's wrong. Is there any way I could configure this in VS Code, in other words, can I specify what's considered an error?
Add the C/C++ extension from Microsoft. It will add IntelliSense
Use this link to learn how to add extensions: LINK
Use this link to read about customizing IntelliSense for your needs: LINK
(unless it already does what you need)

How to show a tutorial for vscode extension?

I am building an extension for VsCode and wanted to show a small tutorial on how to use it, but I can't find an appropriate API for that. Obviously, I can save some variables in the global state to follow user progress and use some FE framework to do some drawing in a webview, but it feels very custom. I saw that VSCode shows a tutorial on initial installation and hoped I can do the same.
In VSCode it is called a walkthrough and is defined simply in package.json. Here is a link to this API: https://code.visualstudio.com/api/references/contribution-points#contributes.walkthroughs
and this an example project https://github.com/microsoft/vscode-extension-samples/blob/main/getting-started-sample/package.json#L39
It is pretty easy to define and use. It accepts text, media files, and markdown files.

is an advanced Python completion possible with Sublime Text 3?

I would like to have a completion in Sublime Text 3, for Python code documents, that would:
Complete the actual object method and other properties (like e.g.: os.path.isd → os.path.isdir without any previous occurence of the word isdir in the document).
Complete the general set of all document's words with a second, lower priority ↔ i.e.: have them listed them after the actual methods.
I would also like to see ST letting the words appearing nearier from the completion point to appear higher in the completion popup window.
Basically, I would like to have a completion resembling the Vim's CoC for C++ in its general features.
Is this possible? If yes, then what should be done to configure Sublime Text 3 for such coimpletion?
The behavior after installing the Python Completions package is far from perfect — all it does is apparently changing the priorities of the basic completion sources (after adding some that i didn't identify), so that it's worse than the shipped original' completion.
The Anaconda package (not at all related to the Anaconda Python distribution) does most of what you're looking for. You may also want to take a look at the LSP package as well.
It's upto you.
You can choose any plugin you like and your computer can support.
Just search the internet about the best python auto-complete.If you feel one of them is best suited for you, search in the package discoverer of Sublime Text for that name. If there is a plugin, install it or read the instructions,etc.
But I heard of some like Kite and Jedi.

Fuzzy file opening in vscode

I am exploring vscode after using atom for a long while. One of the things I'm missing is an equivalent of the lovely package advanced-open-file. Is there something similar to this in vscode?
I found the advanced-new-file extension, but it is only helpful when it comes to new files. I would like to be able to quickly open files from all over my local files (not only the workspace).
Edit: I found the option of workbench.action.quickOpen; but it doesn't allow opening files from the whole file system.
Sorry, but currently the answer is no. The problem is that input box doesn't provide a way to listen to key events:
GitHub issue,
so even the extensions can't do that currently. Here's the comment from advanced-new-file extension creator:
Because VSCode extensions don't yet have the ability to do type-ahead autocomplete within the text input box (See https://github.com/Microsoft/vscode/issues/426), we work around this limitation and provide autocomplete using a two-step workflow of selecting existing path, then providing new filename/path relative to the selection.
The good news is that there is a new API addressing this issue, but it's currently in 'proposed' state and can't be used for published extensions.
One workaround could be typing code -r some/path in integrated terminal and using 'tab' for autocomplete.
The Fuzzy search extension seems to work for me.
It adds a new action to the command palette which allows you to search for files in the current project and open them.

VS Code - Text formatting in a new language extension

I'm building an extension providing a syntax highlighting for the 'Jack' language used in an online course I am taking (Nand2Tetris at Coursera - it is not a part of the course assignment). I have the syntax highlighting rules ready, but I would like to add custom formatting for some language elements. In particular, I would like type definitions to appear in italic.
I know how to change the user settings to get the desired result on my VS Code installation, but I would like that formatting to be the default behavior for anyone using the extension.
I've tried to create a new theme extension and then copy paste the 'themes' folder from it to the 'syntax' extension and reference the file from that folder in package.json, but it didn't work. I also tried adding the 'configuration' setting in the 'contributes' section of package.json, without success. I browsed numerous VC Code extensions on GitHub and couldn't find one providing similar functionality.
Is it even possible to provide syntax definition and 'theming' in one extension? If so how?
Based on VS Code Semantic Highlight Guide, besides syntax highlighting rules, you'll also need
Implement and register a Semantic token provider in your extension.
Declare Enablement of semantic highlighting in settings.json.
Customize tokens in Theming.
VS Code team kindly provides a Semantic tokens sample. Note that this example skips step 3 and customizes tokens directly in settings.json.