atishay / vscode-allautocomplete

Autocomplete from open files for VSCode
MIT License
105 stars 25 forks source link

Failing to Get Custom AutoComplete With AllAutocomplete.languageSpecialCharacters Setting #27

Closed SophtwhereDev closed 5 years ago

SophtwhereDev commented 6 years ago

What I aim to accomplish is a custom autocomplete for namespaced tags within a .csv file which I will either have newline separated or comma and whitespace (", ") separated. So something along these lines:

art:scenery
photo:person
spaces possible:tag
tag:spaces possible

I figured I could get autocomplete for these tags using the AllAutocomplete.languageSpecialCharacters setting and I added the entry "csv": "[A-Za-z0-9 ]+:[A-Za-z0-9 ]+" however this didn't work for me.

I only recently installed this extension so I'm not sure if I'm doing something wrong, I'd appreciate some guidance. Thanks in advance!

atishay commented 5 years ago

Please use the following properties: In "AllAutocomplete.languageWhitespace", add "csv": "[^\w_\u0080-\uFFFF \:]+"

"AllAutocomplete.languageSpecialCharacters", add "csv": "^[\: ]"

I would recommend doing this at the project level as you will be overriding the language specific options for all other languages. You can look at the defaults here.

SophtwhereDev commented 5 years ago

@atishay I tried doing this but it didn't work for me, this is what I added to my config:

    "files.associations": {
        "*.csv": "csv"
    },
    "python.linting.pylintEnabled": true,

    "AllAutocomplete.languageWhitespace": {
        "ruby": "[^\\w\\-_\\$:\\u0080-\\uFFFF]+",
        "javascript": "[^\\w_\\$\\u0080-\\uFFFF]+",
        "javascriptreact": "[^\\w_\\-\\$\\@\\u0080-\\uFFFF]+",
        "typescript": "[^\\w_\\-\\$\\@\\u0080-\\uFFFF]+",
        "php": "[^\\w_\\$\\u0080-\\uFFFF]+",
        "css": "[^\\w\\-_\\$\\u0080-\\uFFFF]+",
        "scss": "[^\\w\\-_\\$\\@\\u0080-\\uFFFF]+",
        "html": "[^\\w\\-_\\$\\u0080-\\uFFFF]+",
        "python": "[^\\w\\-_\\u0080-\\uFFFF]+",
        "elm": "[^\\w\\-_\\u0080-\\uFFFF]+",
        "cpp": "[^\\w_\\u0080-\\uFFFF]+",
        "csv": "[^\\w_\\u0080-\\uFFFF \\:]+"
    },

    "AllAutocomplete.languageSpecialCharacters": {
        "css": "^[\\.#]",
        "scss": "^[\\.#]",
        "csv": "^[\\: ]"
    }

I added extra backslashes to the thing you actually suggested because there was an error for unknown escape character but that was no good too... Is there anything else I could try? I appreciate the help!

atishay commented 5 years ago

If you update to version 18, you can find CSV in the defaults.

SophtwhereDev commented 5 years ago

@atishay I've updated to version 18 and it still doesn't seem to work.

If I have an entry "art:scenery", it only recommends "art" and "scenery" separately.

atishay commented 5 years ago
screen shot 2018-12-13 at 6 28 11 am

With the Rainbow CSV plugin to VScode and selecting CSV as the type, I am able to get this to work. If you are using some other combination, please share that with me and I can get that added to the list.

SophtwhereDev commented 5 years ago

I see, I do not have any csv plugin such as Rainbow CSV installed, I shall try this combination.

EDIT: Perfect, that did the trick. Thank you very much for all the help!