Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to "replace_on_insert" on key binding, not auto_complete_trigger #58

Open
kud opened this issue Aug 1, 2019 · 1 comment
Open

Comments

@kud
Copy link

kud commented Aug 1, 2019

Hey,

I've got a lil problem.

replace_on_insert works like a charm when it's auto_complete_trigger ed like:

{
  "debug": false,
  "exclude_folders": ["node_modules", "bower_components", "src_legacy", "dist"],
  "additional_scopes": [
    {
      // es6 import from/import "*"
      "scope": "string.quoted.double.js.fjsx15",

      "auto": true,
      "relative": false,
      "base_directory": false,
      "prefix": ["from", "import"],
      "extensions": ["ts", "js", "html", "scss", "json"],
      "replace_on_insert": [
        ["/src/", "~/"],
        ["\\.(js|ts)$", ""],
        ["([^.])\\/index$", "\\1"],
        ["^([\\/.]+)?\\/(bower_components|node_modules)\\/", ""]
      ]
    }
  ]
}
"auto_complete_triggers":
	[
		{
			"characters": "abcdefghijklmnopqrstuvwxyz",
			"selector": "string.quoted.double.js.fjsx15"
		}
	],

but when I use the keyboard combo, the replace_on_insert doesn't apply, do you know why?

Kapture 2019-08-02 at 1 11 38

@sagold
Copy link
Owner

sagold commented Sep 8, 2019

Actually no. I am using the default rule for this scope and the regex gets applied for absolute and relative insertions. Do you run on windows or get any error messages in the console?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants