77 "github.com/microsoft/typescript-go/internal/ast"
88 "github.com/microsoft/typescript-go/internal/core"
99 "github.com/microsoft/typescript-go/internal/format"
10+ "github.com/microsoft/typescript-go/internal/ls/lsutil"
1011 "github.com/microsoft/typescript-go/internal/parser"
1112 "gotest.tools/v3/assert"
1213)
@@ -16,14 +17,14 @@ func TestCommentFormatting(t *testing.T) {
1617
1718 t .Run ("format comment issue reproduction" , func (t * testing.T ) {
1819 t .Parallel ()
19- ctx := format .WithFormatCodeSettings (t .Context (), & format .FormatCodeSettings {
20- EditorSettings : format .EditorSettings {
20+ ctx := format .WithFormatCodeSettings (t .Context (), & lsutil .FormatCodeSettings {
21+ EditorSettings : lsutil .EditorSettings {
2122 TabSize : 4 ,
2223 IndentSize : 4 ,
2324 BaseIndentSize : 4 ,
2425 NewLineCharacter : "\n " ,
2526 ConvertTabsToSpaces : true ,
26- IndentStyle : format .IndentStyleSmart ,
27+ IndentStyle : lsutil .IndentStyleSmart ,
2728 TrimTrailingWhitespace : true ,
2829 },
2930 InsertSpaceBeforeTypeAnnotation : core .TSTrue ,
@@ -67,14 +68,14 @@ func TestCommentFormatting(t *testing.T) {
6768
6869 t .Run ("format JSDoc with tab indentation" , func (t * testing.T ) {
6970 t .Parallel ()
70- ctx := format .WithFormatCodeSettings (t .Context (), & format .FormatCodeSettings {
71- EditorSettings : format .EditorSettings {
71+ ctx := format .WithFormatCodeSettings (t .Context (), & lsutil .FormatCodeSettings {
72+ EditorSettings : lsutil .EditorSettings {
7273 TabSize : 4 ,
7374 IndentSize : 4 ,
7475 BaseIndentSize : 0 ,
7576 NewLineCharacter : "\n " ,
7677 ConvertTabsToSpaces : false , // Use tabs
77- IndentStyle : format .IndentStyleSmart ,
78+ IndentStyle : lsutil .IndentStyleSmart ,
7879 TrimTrailingWhitespace : true ,
7980 },
8081 InsertSpaceBeforeTypeAnnotation : core .TSTrue ,
@@ -104,14 +105,14 @@ func TestCommentFormatting(t *testing.T) {
104105
105106 t .Run ("format comment inside multi-line argument list" , func (t * testing.T ) {
106107 t .Parallel ()
107- ctx := format .WithFormatCodeSettings (t .Context (), & format .FormatCodeSettings {
108- EditorSettings : format .EditorSettings {
108+ ctx := format .WithFormatCodeSettings (t .Context (), & lsutil .FormatCodeSettings {
109+ EditorSettings : lsutil .EditorSettings {
109110 TabSize : 4 ,
110111 IndentSize : 4 ,
111112 BaseIndentSize : 0 ,
112113 NewLineCharacter : "\n " ,
113114 ConvertTabsToSpaces : false , // Use tabs
114- IndentStyle : format .IndentStyleSmart ,
115+ IndentStyle : lsutil .IndentStyleSmart ,
115116 TrimTrailingWhitespace : true ,
116117 },
117118 InsertSpaceBeforeTypeAnnotation : core .TSTrue ,
@@ -137,14 +138,14 @@ func TestCommentFormatting(t *testing.T) {
137138
138139 t .Run ("format comment in chained method calls" , func (t * testing.T ) {
139140 t .Parallel ()
140- ctx := format .WithFormatCodeSettings (t .Context (), & format .FormatCodeSettings {
141- EditorSettings : format .EditorSettings {
141+ ctx := format .WithFormatCodeSettings (t .Context (), & lsutil .FormatCodeSettings {
142+ EditorSettings : lsutil .EditorSettings {
142143 TabSize : 4 ,
143144 IndentSize : 4 ,
144145 BaseIndentSize : 0 ,
145146 NewLineCharacter : "\n " ,
146147 ConvertTabsToSpaces : false , // Use tabs
147- IndentStyle : format .IndentStyleSmart ,
148+ IndentStyle : lsutil .IndentStyleSmart ,
148149 TrimTrailingWhitespace : true ,
149150 },
150151 InsertSpaceBeforeTypeAnnotation : core .TSTrue ,
@@ -171,14 +172,14 @@ func TestCommentFormatting(t *testing.T) {
171172 // Regression test for issue #1928 - panic when formatting chained method call with comment
172173 t .Run ("format chained method call with comment (issue #1928)" , func (t * testing.T ) {
173174 t .Parallel ()
174- ctx := format .WithFormatCodeSettings (t .Context (), & format .FormatCodeSettings {
175- EditorSettings : format .EditorSettings {
175+ ctx := format .WithFormatCodeSettings (t .Context (), & lsutil .FormatCodeSettings {
176+ EditorSettings : lsutil .EditorSettings {
176177 TabSize : 4 ,
177178 IndentSize : 4 ,
178179 BaseIndentSize : 0 ,
179180 NewLineCharacter : "\n " ,
180181 ConvertTabsToSpaces : false , // Use tabs
181- IndentStyle : format .IndentStyleSmart ,
182+ IndentStyle : lsutil .IndentStyleSmart ,
182183 TrimTrailingWhitespace : true ,
183184 },
184185 InsertSpaceBeforeTypeAnnotation : core .TSTrue ,
@@ -208,14 +209,14 @@ func TestSliceBoundsPanic(t *testing.T) {
208209
209210 t .Run ("format code with trailing semicolon should not panic" , func (t * testing.T ) {
210211 t .Parallel ()
211- ctx := format .WithFormatCodeSettings (t .Context (), & format .FormatCodeSettings {
212- EditorSettings : format .EditorSettings {
212+ ctx := format .WithFormatCodeSettings (t .Context (), & lsutil .FormatCodeSettings {
213+ EditorSettings : lsutil .EditorSettings {
213214 TabSize : 4 ,
214215 IndentSize : 4 ,
215216 BaseIndentSize : 4 ,
216217 NewLineCharacter : "\n " ,
217218 ConvertTabsToSpaces : true ,
218- IndentStyle : format .IndentStyleSmart ,
219+ IndentStyle : lsutil .IndentStyleSmart ,
219220 TrimTrailingWhitespace : true ,
220221 },
221222 InsertSpaceBeforeTypeAnnotation : core .TSTrue ,
0 commit comments