Commit Graph

215 Commits

Author SHA1 Message Date
Aiday Marlen Kyzy
d309e11579
Remove brackets from comments, strings and regexes before evaluating the indentation (#210641)
* wip

* polishing the code

* adding code

* adding the language

* reshuffling the code to avoid cyclic dependency

* polihsing code

* uncommenting tests

* also adopting the indentation rules within the reindentation operation

* using instead the sliced line tokens instead of the scoped line tokens

* polishing the code

* using start indices instead

* using value everywhere

* using the token data to type the tokens

* setting to number instead of standard token type

* using token data from autoindenttest.ts

* using same code in both test files

* placing instantiation service into the registerLanguage method

* copying object into the node js autoindent.ts
2024-05-27 11:18:00 +02:00
Aiday Marlen Kyzy
a00f2e64f4
Merge pull request #208291 from microsoft/aiday/addingIndentationForIfForWhile
Indent next line for if/for/while statement followed by whitespace
2024-03-22 11:07:52 +01:00
Aiday Marlen Kyzy
f2758ed8f7
making the regex more restrictive 2024-03-21 17:56:44 +01:00
Aiday Marlen Kyzy
d8a989efdd
adding rules to indent from within [], (), {} 2024-03-21 17:30:16 +01:00
Aiday Marlen Kyzy
20b54ec19e
making the regex pattern so that we don't match if/for/while inside of a word 2024-03-21 17:24:52 +01:00
Aiday Marlen Kyzy
5d1d7d98a6
adding parentheses aroudn the two different alternatives 2024-03-21 17:14:53 +01:00
Aiday Marlen Kyzy
0629845986
Merge branch 'main' into aiday/addingIndentationForIfForWhile 2024-03-21 17:10:29 +01:00
Aiday Marlen Kyzy
3aa12f6c38
simpler function is used in order to cover lambda functions 2024-03-21 15:07:52 +01:00
Aiday Marlen Kyzy
62275bbca6
changing to round brackets inside of the regex pattern 2024-03-21 12:43:17 +01:00
Aiday Marlen Kyzy
5228f5a8b6
adding dollar sign at the end of the regex to match the full line 2024-03-21 12:13:20 +01:00
Aiday Marlen Kyzy
32aaeac3d6
adding pattern for if for and while 2024-03-21 11:04:24 +01:00
Aiday Marlen Kyzy
69f9c7a2e1
adding pattern in order to indent the next line 2024-03-21 10:27:30 +01:00
Aiday Marlen Kyzy
946d53e850
Merge branch 'main' into fix-autoindent-on-closing-paren 2024-03-11 09:42:02 +01:00
rzvc
e7b03742b5
Fix docblock expansion in TS, when asterisk not preceded by a space (#204400)
Fixes issue #193263.
2024-02-06 03:52:06 +00:00
Alex Ross
35d97bc7e4
Update grammars (#203521) 2024-01-26 13:06:22 +01:00
Sandeep Somavarapu
1e0580ec23
Use categories for builtin extensions groups (#202453)
* support grouping of extensions

* remove grouping

* reuse categories parsing

* cleanup

* fix tests
2024-01-14 18:19:29 +01:00
Russell Davis
bac1926029 Fix decreaseIndentPattern for javascript and typescript
Fixes #201424

It wasn't matching closing parens, which resulted in these issues:
* Pressing enter with just a closing paren to the right of the caret
wouldn't result in a dedent on the next line
* With the caret at the start of the line below a line containing only a
closing paren, pressing tab would result in an extra level of
indentation
2023-12-22 20:15:13 -08:00
Alpha Romer Coma
7ef754c2f6
Fix supported markdown-lint violations in markdown files (#190750)
docs: fix supported markdownlint violations
2023-08-24 08:37:25 +00:00
Remco Haszing
e0485e9d8f
Mark all .tsbuildinfo files as json (#189811)
TypeScript emits a `.tsbuildinfo` file whose file base name matches the
TypeScript configuration file. Typically this configuration file is
named `tsconfig.json`, meaning TypeScript will generate
`tsconfig.tsbuildinfo`. However, if the config file is named
differently, TypeScript will generate another `.tsbuildinfo` file.
2023-08-07 19:32:21 +00:00
Henning Dieterichs
fd63cf62b9
Merge branch 'main' into singleLineDeindent 2023-07-07 20:30:51 +02:00
Alex Ross
c778cc6117
Update grammars (#186752) 2023-06-30 09:14:40 -07:00
Matt Bierner
b242a8730c
Bump JS/TS grammars (#180160) 2023-04-17 21:27:38 +01:00
Matt Bierner
0461b885d5
Update JS/TS grammar (#179069) 2023-04-04 00:56:01 +02:00
Henning Dieterichs
e3cab63a12
Merge branch 'main' into singleLineDeindent 2023-02-28 11:16:22 +01:00
Alex Ross
cf4acb8050
Update grammars (#175350) 2023-02-24 17:22:41 +01:00
Henning Dieterichs
18b96f483c
Fixes #173997 (#175349) 2023-02-24 17:18:37 +01:00
Henning Dieterichs
d6259480f5
Fixes #173997 (#174067) 2023-02-10 15:29:40 +01:00
Alex Ross
166b8e2d90
Update grammars (#172807) 2023-01-30 06:27:20 -08:00
Matt Bierner
c1498b35dd
Fix includes check on jsdoc patching (#169446) 2022-12-16 23:36:22 +01:00
Matt Bierner
9ad5c4a205
Use JSX in display names of the TypeScript React and JavaScript React languages (#168368)
Use JSX in display names of the TypeScript React and JavaScript React languages

Fixes #138285

This changes the display name of the languages `JavaScript React` -> `JavaScript JSX` and `TypeScript React` -> `TypeScript JSX`

This only changes the display names and leaves the ids alone. Changing the ids would be a very breaking change for extensions with no real user benefits
2022-12-08 00:56:04 +01:00
Matt Bierner
cf01f3bb99
Update TS grammars (#167479)
Pulls in support for TS accessor syntax
2022-11-28 16:30:49 -08:00
Stephen Sigwart
3894c48a02 JS/TS fixes 2022-11-21 21:41:18 -05:00
Stephen Sigwart
a9dac55c8a
Merge branch 'main' into singleLineDeindent 2022-11-21 20:46:58 -05:00
Matt Bierner
46caa3b490
Exclude @ from word pattern in js/ts (#165764)
Fixes #162862

#148874 Still seems to be working too after this change
2022-11-07 15:53:11 -08:00
Stephen Sigwart
10fe0823a3
Merge branch 'main' into singleLineDeindent 2022-10-27 08:19:18 -04:00
Alex Ross
fd4346210f
Update grammars (#162673) 2022-10-04 08:50:55 -07:00
Harald Kirschner
ea5b244abd
File snippets for HTML and PHP (#161881)
* Adding file snippets for HTML and PHP to start small.

* Adding TS
2022-09-27 08:15:57 -07:00
Alex Ross
ec5b41ddc2
Update grammars (#159445)
Update grammar
2022-08-29 14:08:44 +02:00
Bryan Lee
fac840f22c Add support for angle bracket matching and colorization in Typescript 2022-06-29 01:59:31 +08:00
Matt Bierner
9f3cafba7d
Update grammars (#151383)
Updates the markdown and JS/TS grammars
2022-06-07 09:37:14 -07:00
Stephen Sigwart
16f501ee33 Fix single line if/else and loop indentation 2022-06-04 23:55:58 -04:00
Remco Haszing
a9fc85ff47
Specify tsconfig.tsbuildinfo is json (#149065) 2022-05-10 08:59:40 -07:00
Matt Bierner
e6f42433cf
Include @ in JS/TS word pattern (#148962)
Fixes #148874

`@` is used both for decorators and in imports
2022-05-06 21:10:45 +00:00
Alex Ross
f3b1b53443
Update grammars 2022-05-02 11:20:10 +02:00
Matt Bierner
e9636bbce1
Don't have space in snippet
Fixes #146503
2022-04-01 11:15:25 -07:00
Matt Bierner
1da08937d8
Remove text mate highlighting of more JS/TS built-ins
Identifying specific symbols is a better fit for semantic highlighting instead of textmate as semantic highlighting prevents false positives

This keeps around a few of the most built-ins for now but we may revisit these in the future
2022-03-01 16:17:16 -08:00
Matt Bierner
b391749606
Move update grammar script to mjs 2022-03-01 15:56:27 -08:00
Matt Bierner
76a647c33c
Fix tested pattern 2022-02-28 14:49:29 -08:00
Matt Bierner
062b82c1bc
Use .test instead of .match 2022-02-28 14:27:47 -08:00
Matt Bierner
2b92835853
Move js/ts language configs to json file
Fixes #125748
2022-02-03 11:38:09 -08:00