@@ -167,15 +167,15 @@ SlangResult LanguageServer::parseNextMessage()
167
167
if (response.result .getKind () == JSONValue::Kind::Array)
168
168
{
169
169
auto arr = m_connection->getContainer ()->getArray (response.result );
170
- if (arr.getCount () == 11 )
170
+ if (arr.getCount () == 12 )
171
171
{
172
172
updatePredefinedMacros (arr[0 ]);
173
173
updateSearchPaths (arr[1 ]);
174
174
updateSearchInWorkspace (arr[2 ]);
175
175
updateCommitCharacters (arr[3 ]);
176
- updateFormattingOptions (arr[4 ], arr[5 ], arr[6 ], arr[7 ]);
177
- updateInlayHintOptions (arr[8 ], arr[9 ]);
178
- updateTraceOptions (arr[10 ]);
176
+ updateFormattingOptions (arr[4 ], arr[5 ], arr[6 ], arr[7 ], arr[ 8 ] );
177
+ updateInlayHintOptions (arr[9 ], arr[10 ]);
178
+ updateTraceOptions (arr[11 ]);
179
179
}
180
180
}
181
181
break ;
@@ -1149,6 +1149,7 @@ SlangResult LanguageServer::formatting(const LanguageServerProtocol::DocumentFor
1149
1149
}
1150
1150
if (m_formatOptions.clangFormatLocation .getLength () == 0 )
1151
1151
m_formatOptions.clangFormatLocation = findClangFormatTool ();
1152
+ m_formatOptions.fileName = canonicalPath;
1152
1153
auto edits = formatSource (doc->getText ().getUnownedSlice (), -1 , -1 , -1 , m_formatOptions);
1153
1154
auto textEdits = translateTextEdits (doc, edits);
1154
1155
m_connection->sendResult (&textEdits, responseId);
@@ -1332,12 +1333,13 @@ void LanguageServer::updateCommitCharacters(const JSONValue& jsonValue)
1332
1333
}
1333
1334
}
1334
1335
1335
- void LanguageServer::updateFormattingOptions (const JSONValue& clangFormatLoc, const JSONValue& clangFormatStyle, const JSONValue& allowLineBreakOnType, const JSONValue& allowLineBreakInRange)
1336
+ void LanguageServer::updateFormattingOptions (const JSONValue& clangFormatLoc, const JSONValue& clangFormatStyle, const JSONValue& clangFormatFallbackStyle, const JSONValue& allowLineBreakOnType, const JSONValue& allowLineBreakInRange)
1336
1337
{
1337
1338
auto container = m_connection->getContainer ();
1338
1339
JSONToNativeConverter converter (container, m_connection->getSink ());
1339
1340
converter.convert (clangFormatLoc, &m_formatOptions.clangFormatLocation );
1340
1341
converter.convert (clangFormatStyle, &m_formatOptions.style );
1342
+ converter.convert (clangFormatFallbackStyle, &m_formatOptions.fallbackStyle );
1341
1343
converter.convert (allowLineBreakOnType, &m_formatOptions.allowLineBreakInOnTypeFormatting );
1342
1344
converter.convert (allowLineBreakInRange, &m_formatOptions.allowLineBreakInRangeFormatting );
1343
1345
if (m_formatOptions.style .getLength () == 0 )
@@ -1396,6 +1398,8 @@ void LanguageServer::sendConfigRequest()
1396
1398
args.items .add (item);
1397
1399
item.section = " slang.format.clangFormatStyle" ;
1398
1400
args.items .add (item);
1401
+ item.section = " slang.format.clangFormatFallbackStyle" ;
1402
+ args.items .add (item);
1399
1403
item.section = " slang.format.allowLineBreakChangesInOnTypeFormatting" ;
1400
1404
args.items .add (item);
1401
1405
item.section = " slang.format.allowLineBreakChangesInRangeFormatting" ;
0 commit comments