Skip to content

parse formatting options in initialization, and pull editor scope during Configuration #2717

Open
iisaduan wants to merge 19 commits intomicrosoft:mainfrom
iisaduan:vsformat
Open

parse formatting options in initialization, and pull editor scope during Configuration #2717
iisaduan wants to merge 19 commits intomicrosoft:mainfrom
iisaduan:vsformat

Conversation

@iisaduan
Copy link
Member

@iisaduan iisaduan commented Feb 9, 2026

@iisaduan iisaduan marked this pull request as ready for review February 13, 2026 22:32
Copilot AI review requested due to automatic review settings February 13, 2026 22:32
@iisaduan iisaduan changed the title [draft] parse formatting options in initialization parse formatting options in initialization, and pull editor scope during Configuration Feb 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables the language server to accept formatting options during initialization and updates configuration parsing to support the new js/ts configuration key alongside existing typescript and javascript keys. It also adds support for editor settings to configure formatting preferences.

Changes:

  • Added support for receiving formatting options via initializationOptions in the initialization request
  • Updated configuration parsing to use a map-based approach with support for js/ts, typescript, javascript, and editor keys
  • Fixed numeric type parsing to handle float64 values from JSON (addressing the indenting issue where indentSize = 2 was being ignored)

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
testdata/baselines/reference/fourslash/state/codeLensAcrossProjects.baseline Updated test baseline to reflect the new js/ts configuration key
internal/project/session_test.go Updated test calls to use map-based configuration instead of array-based
internal/lsp/server.go Added initialization options parsing, updated configuration request handling to include editor settings, and simplified didChangeConfiguration handling
internal/lsp/lsproto/lsp_generated.go Added Typescript field to InitializationOptions struct for receiving formatting preferences
internal/lsp/lsproto/_generate/generate.mts Added typescript field to custom structures and fixed OrType name parsing
internal/ls/lsutil/userpreferences.go Added float64 case to handle JSON numeric parsing
internal/ls/lsutil/formatcodeoptions.go Added ParseEditorSettings method to parse editor-level formatting options
internal/ls/lsutil/configuration.go Refactored configuration parsing from array-based to map-based approach
internal/fourslash/fourslash.go Updated test configuration to use js/ts key instead of typescript

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

Successfully merging this pull request may close these issues.

3 participants

Comments