Commit Graph
28 Commits
Author SHA1 Message Date
05e29316e7 fix: bug in Restrict continue comment (#322668)
* fix: Restrict continue comment to whitespace separated slashes

* fix: bug introduced in #321230

---------

Co-authored-by: Dmitriy Vasyura <dmitriv@microsoft.com>
2026-07-29 00:47:49 +00:00
58a6f63814 fix(javascript): sync JSDoc continuation patterns with TypeScript language config (#308433)
fix(javascript): sync JSDoc continuation patterns with TypeScript config

Both language configuration files carry a comment stating they should
stay in sync with each other, but two JSDoc-related regex patterns had
drifted in the JavaScript file.

1. `unIndentedLinePattern` — the third alternative that matches an
   in-progress JSDoc continuation line (`* comment text`) required a
   literal space immediately before the `*`:
     Before: `^(\\t|[ ])*[ ]\\*([ ]...`
     After:  `^(\\t|[ ])*\\*([ ]...`

2. `onEnterRules` — the `beforeText` pattern for the rule that appends
   `* ` when pressing Enter inside a JSDoc block had the same extra
   space requirement.

The TypeScript configuration does not require this leading space, which
means that JSDoc comments whose `*` continuation lines are indented with
tabs only (e.g. `\t* line`) were recognized correctly in TypeScript
files but not in JavaScript files. After this change both files use the
same permissive pattern.

Also aligns the `wordPattern` character-class order (`@~` → `@~`,
purely cosmetic, no behavioral difference).

Co-authored-by: yogeshwaran-c <yogeshwaran.c@example.com>
Co-authored-by: Dmitriy Vasyura <dmitriv@microsoft.com>
2026-07-27 23:02:25 +00:00
RedCMDandGitHub 9b43a71f03 fix: Restrict continue comment to whitespace separated slashes (#321230) 2026-06-14 05:11:51 +00:00
RedCMDandGitHub 4fea0d7662 Add TS/JS Template surrounding brackets (#255972) 2026-01-05 10:00:54 +00:00
2b7ad1a13f TypeScript restrict Comment onEnterRules inside comment body (#251692)
* TypeScript: Restrict Comment onEnterRules cursor inside comment body

* TypeScript: Simply Comment onEnterRule

* polish

---------

Co-authored-by: Aiday Marlen Kyzy <amarlenkyzy@microsoft.com>
2025-06-17 13:52:11 +00:00
7c43b02d62 Update indentation for PHP, JS, and TS (#251465)
* Update indentation for PHP, JS, and TS.

Addresses https://github.com/microsoft/vscode/issues/136592

- For PHP, auto-indent after `if`, `elseif`, `else if`, `while`, `for` and `foreach`. This also fixes an issue where hitting Enter on a blank line below a single line `if` (or other) results in an extra tab.
- For PHP, extra dot after `*/` and blank line.
- For JS/TS, auto-indent for `else` to be consistent with handling of `if` statements

* polish

---------

Co-authored-by: Aiday Marlen Kyzy <amarlenkyzy@microsoft.com>
2025-06-17 09:41:12 +00:00
Aiday Marlen KyzyandGitHub fb3a36133e Removing double slash from wtihin regex in onEnter rule (#242679)
removing double slash from wtihin regex in onEnter rule
2025-03-05 12:28:46 +01:00
Aiday Marlen KyzyandGitHub 1430e1845c Ignoring URLs when adding line comment onEnter (#239576)
removing urls from this regex
2025-02-04 10:38:17 +01:00
Aiday Marlen KyzyandGitHub c0d25ffb56 Performance regression: revert "Ignoring double slashes inside of strings" (#235742)
Revert "onEnter Indentation Rules: Ignoring double slashes inside of strings …"

This reverts commit 21c52a4a3a.
2024-12-10 16:49:07 +01:00
Aiday Marlen KyzyandGitHub 21c52a4a3a onEnter Indentation Rules: Ignoring double slashes inside of strings (#235712)
ignoring double slashes inside of strings
2024-12-10 11:02:51 +01:00
Aiday Marlen KyzyandGitHub e8e5333cbb Add comment on next line when not at the end of the line comment in onEnter rules (#233219)
adding line comment when not at the end of a line
2024-11-06 17:45:54 +01:00
Aiday Marlen KyzyandGitHub 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 KyzyandGitHub f62931d09b Making same changes to JavaScript language configuration file as for TypeScript (#209038)
making the language configuration file the same as for typescript
2024-03-28 18:25:55 +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
Stephen Sigwart 3894c48a02 JS/TS fixes 2022-11-21 21:41:18 -05:00
Matt BiernerandGitHub 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
Matt BiernerandGitHub 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
Matt Bierner 2b92835853 Move js/ts language configs to json file
Fixes #125748
2022-02-03 11:38:09 -08:00
Matt Bierner ffd414feeb Include < as surroundingPairs in JS
Fixes #136127

These are already listed in TS
2021-10-29 13:03:15 -07:00
Henning Dieterichs d6b2e78477 Fixes #132847 by configuring ${...} as bracket pair. 2021-09-21 12:28:25 +02:00
Jackson Kearl 4dff8da77b remove comments for more proper json 2018-08-08 10:43:16 -07:00
Jackson Kearl 763e939bdd Document jsx specialization 2018-07-24 00:38:38 -07:00
Jackson Kearl 629c05f1f8 Add special case for js(x) template strings 2018-07-24 00:07:42 -07:00
Martin Aeschlimann cf70385df5 Folding regions broken 2017-10-12 16:55:15 +02:00
Martin Aeschlimann 1fb361861f [folding] add work boundries to folding markers 2017-10-11 17:28:10 +02:00
Martin Aeschlimann 777fddd4f7 [folding] add folding marker to API and schema 2017-09-25 22:25:45 +02:00
Martin Aeschlimann 9e05d4b635 [folding] fold regions, initial, preconfigured support. For #12146 2017-09-22 13:50:03 +02:00
Martin Aeschlimann d826ad6e4f [jsx][tsx] Wrong type of comments for React code. Fixes #6461 2017-01-07 10:57:37 -04:00