Enabling Auto-Complete for custom syntax in Sublime text - autocomplete

I cannot get Sublime auto complete to work properly for custom syntaxes. For example, this is what happens when the syntax is set to Javascript:
When the syntax is set to my custom syntax, these types of suggestions never show up. Custom snippets show up just fine, but variables found in the file do not show up properly. When I click [CTRL+SPACE], this is what I get:
For some reason, single characters will show up, but not whole words. For the syntax, I copied the Completion Rules.tmPreferences, Symbol List.tmPreferences, etc. directly from here so that all should be fine (although messing around with them didn't seem to do anything).
I have tried adding the syntax to auto_complete_selector in settings, but it does not work. I use the package All Autocomplete, and deleting this did not change anything.

Related

Format only pasted code segment in VSCode, not entire document

Is there a way to do so? I find a lot of my time is taken up correcting indentation formatting in VSCode after pasting, because it seems to sometimes take the source indenting and apply it at the destination (so the entire pasted code block is at the wrong indent level) or worse, just mess up indents entirely (no idea what's going on here) and I need to manually fix every line.
Example use case, for single PHP files which contain PHP, HTML, and Javascript, I often only want the pasted Javascript block to format nicely. Turning on "paste on format" will format the entire document, often times making the PHP sections awkwardly arranged.
I know that VSCode has "format on paste" in settings, but this formats the entire document. How can I format only the pasted code? Is this even possible?
Thank you
I am not certain whether you're fine with this roundabout solution, but you can format selection with Ctrl+K Ctrl+F (see official vscode site for more detail). So rather than turning on format on paste you can paste and then reselect it and do the shortcut above.
If you're not satisfied with this method, you can try using a vscode extension that was given here under a somewhat similar copy and paste problem

VsCode - Weird JSX prop autocomplete behavior

When writing JSX props in typescript, this is what it normally looks like for me, works as expected:
However, if I let VsCode autocomplete the style (or another) tag like this:
then I get into a weird mode where the space between the braces has a gray background:
In this mode, autocomplete does not work (you can see that the first line of the popup is not highlighted). Pressing return produces a newline instead of accepting the first suggestion.
When adding new lines, it looks like this:
My questions are:
What is this strange mode supposed to do?
Is this intended or a bug?
What is it called?
Can I disable it?
VsCode 1.75.0 on Windows 10

Prevent Visual Studio Code auto-completing incorrectly whilst I type

I'm having an issue with VS Code autocomplete (intellisense?) that seems completely illogical, but I can't figure out how to disable it (partly because I've no idea what to actually search for this.)
My most recent example is illustrated in the screenshot below. I am typing out a media query #media (min-width: 768px)
I then follow this up with and to continue the query, yet VS Code has for some reason decided I must want to insert a random unrelated variable here. It doesn't even have the string and anywhere in the variable names suggested.
I am fine with suggestions - they are useful when I want. But the second I hit the space bar, it automatically replaces my text. It is replacing my text despite me doing nothing other than typing what I want to type.
So many times I have been caught out because my correctly typed code is being replaced without any interaction whatsoever on my part. How do I prevent this happening?
Thanks for any help.
Intellisense does not autocomplete on space, and this is not part of its default config either. Therefore this is either a bug (which could be the case), or a misconfiguration caused by an extension or changes to settings.json.
One solution for it would be to disable autocomplete on commit character altogether with "editor.acceptSuggestionOnCommitCharacter": false in settings.json. If "editor.acceptSuggestionOnEnter": "on" is left untouched, autocomplete will then only be triggered on tab/enter.

IntelliSense completion doesn't show any code

I don't know what to do. I tried everything I could but IntelliSense automatic completion shows "-" instead of the code. I think the font is very small but i cant change it. I'm not sure though if it's the size.

Creating Code Blocks <code> or <pre> in CKEditor

Is there a plugin to allow users to create <code/> or <pre/> blocks?
If I pass in some html that includes <code> </code> blocks the contents shows up, but with no visual indication that it is different from any other text. Thats inconvenient, but I can't seem to find a way that a user could select a block of code they typed that they want to appear literally and click a button to indicate that.
I'm still pretty new to the CKEditor, but I know Telerik has a pretty graceful implementation of this. (just click the upper right toolbar button titled "Format Code Block").
Does this editor support that? Are their any plugins that add this functionality?
As for pre-elements, there is this plugin by wwalc: http://ckeditor.com/addon/insertpre
It is also available in GitHub: https://github.com/wwalc/insertpre
The only issue is that it hasn't been updated in a while - It officially only supports CKE up to version 4.1 - so there might be some ACF problems at least. You can search for alternatives at http://ckeditor.com/addons/plugins/all using keywords like code and pre, this will always show the most up to date results.
For code blocks you can also use the Text Formats feature - by default it is available in the Standard and Full presets, though you can also add it to your custom build.
When the Format plugin is enabled, it adds the Format drop-down list to your toolbar. Check the Formatted text format - it wraps the active text block with <pre> tags. Note that it works on block-level, so you don't even need to perform any text selection. However, this also means it's not appropriate for inline formatting.
You can also add some custom styling to the Formatted format by adjusting the config.format_pre definition. See the Applying Block-Level Text Formats sample for demos of both the default implementation and custom format definition (scroll down the sample page to get the complete source code for both solutions).
As for inline code formatting, the Styles drop-down list contains the inline Computer Code style that wraps a text selection with <code> tags. Likewise, you can (and actually should) customize the styling that is applied with this feature.
Additionally, for some really fancy code formatting, see the optional Code Snippet plugin. It lets you insert code snippets with syntax highlighting into the editor. These snippets look great (you can also choose a theme that you like) and since they are implemented as widgets, they have all advantages of CKEditor widgets: a code snippet is treated as a single entity inside the editor, you can select it as a whole, delete, change its position with drag&drop etc. See the documentation and sample for more information and examples.