@@ -22,7 +22,7 @@ void CodeSpellChecker::LoadDictionaryFromBuffer(std::string_view buffer)
2222 _symSpell->LoadWordDictionaryFromBuffer (buffer);
2323}
2424
25- void CodeSpellChecker::Analysis (DiagnosisContext& ctx)
25+ void CodeSpellChecker::Analysis (DiagnosisContext& ctx, const std::set<std::string>& tempDict )
2626{
2727 auto parser = ctx.GetParser ();
2828 auto tokenParser = parser->GetTokenParser ();
@@ -31,7 +31,7 @@ void CodeSpellChecker::Analysis(DiagnosisContext& ctx)
3131 {
3232 if (token.TokenType == TK_NAME)
3333 {
34- IdentifyAnalysis (ctx, token);
34+ IdentifyAnalysis (ctx, token, tempDict );
3535 }
3636 }
3737}
@@ -150,7 +150,7 @@ std::vector<SuggestItem> CodeSpellChecker::GetSuggests(std::string word)
150150 return suggests;
151151}
152152
153- void CodeSpellChecker::IdentifyAnalysis (DiagnosisContext& ctx, LuaToken& token)
153+ void CodeSpellChecker::IdentifyAnalysis (DiagnosisContext& ctx, LuaToken& token, const std::set<std::string>& tempDict )
154154{
155155 std::shared_ptr<IdentifyParser> parser = nullptr ;
156156 std::string text (token.Text );
@@ -174,7 +174,7 @@ void CodeSpellChecker::IdentifyAnalysis(DiagnosisContext& ctx, LuaToken& token)
174174
175175 for (auto & word : words)
176176 {
177- if (!word.Item .empty () && !_symSpell->IsCorrectWord (word.Item ))
177+ if (!word.Item .empty () && !_symSpell->IsCorrectWord (word.Item ) && tempDict. count (word. Item ) == 0 )
178178 {
179179 auto range = TextRange (token.Range .StartOffset + word.Range .Start ,
180180 token.Range .StartOffset + word.Range .Start + word.Range .Count - 1
0 commit comments