Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
spectatorBH committed Jan 2, 2024
2 parents 0b96031 + 5cd6ab9 commit 817683f
Show file tree
Hide file tree
Showing 135 changed files with 6,672 additions and 4,960 deletions.
18 changes: 10 additions & 8 deletions CodeCompletion/CodeCompletion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ public DomConverter Compile(string FileName, string Text)
Warnings.Clear();
try
{
//cu = ParsersController.GetComilationUnit(FileName, Text+")))));end.",comp.CompilerOptions.ParserSearchPatchs,ErrorsList);
//cu = ParsersControllerGetComilationUnit(FileName, get_temp_text(Text), ErrorsList, true);
//cu = ParsersController.GetComilationUnit(file_name, Text+")))));end.",comp.CompilerOptions.ParserSearchPatchs,ErrorsList);
//cu = ParsersControllerGetComilationUnit(file_name, get_temp_text(Text), ErrorsList, true);
string tmp = ParsersHelper.GetModifiedProgramm(Text);
if (tmp != null)
{
Expand Down Expand Up @@ -164,7 +164,7 @@ public DomConverter Compile(string FileName, string Text)
}
}
if (docs != null) docs.Clear();
//if (dconv.is_compiled) comp_modules[FileName]=dconv;
//if (dconv.is_compiled) comp_modules[file_name]=dconv;
return dconv;
//ConvertToDom(cu);
}
Expand Down Expand Up @@ -233,7 +233,7 @@ public DomConverter CompileAllIfNeed(string FileName, string Text)
{
ErrorsList.Clear();
Warnings.Clear();
//cu = ParsersControllerGetComilationUnit(FileName, Text, ErrorsList, true);
//cu = ParsersControllerGetComilationUnit(file_name, Text, ErrorsList, true);
if (comp_modules[FileName] == null)
{
string tmp = ParsersHelper.GetModifiedProgramm(Text);
Expand All @@ -260,7 +260,7 @@ public DomConverter CompileAllIfNeed(string FileName, string Text)
dconv.ConvertToDom(cu);
}
}
//comp_modules[FileName] = dconv;
//comp_modules[file_name] = dconv;
if (dconv.is_compiled) comp_modules[FileName] = dconv;

if (docs != null) docs.Clear();
Expand Down Expand Up @@ -299,7 +299,7 @@ public DomConverter CompileAllIfNeed(string FileName, bool parse_only_interface=
{
ErrorsList.Clear();
Warnings.Clear();
//cu = ParsersControllerGetComilationUnit(FileName, Text, ErrorsList, true);
//cu = ParsersControllerGetComilationUnit(file_name, Text, ErrorsList, true);
if (comp_modules[FileName] == null)
{
string tmp = ParsersHelper.GetModifiedProgramm(Text);
Expand Down Expand Up @@ -327,7 +327,7 @@ public DomConverter CompileAllIfNeed(string FileName, bool parse_only_interface=
}
if (dconv.is_compiled) comp_modules[FileName] = dconv;
if (docs != null) docs.Clear();
//comp_modules[FileName] = dconv;
//comp_modules[file_name] = dconv;
// GC.Collect();
return dconv;
}
Expand Down Expand Up @@ -376,9 +376,11 @@ public string[] GetTypeKeywords()
const string LibSourceDirectoryIdent = "%LIBSOURCEDIRECTORY%";
public static string FindSourceFileName(string unit_name, out int found_dir_ind, params string[] ddirs)
{
// TODO: check error in older version
List<string> Dirs = new List<string>();
Dirs.AddRange(ddirs);
Dirs.AddRange(CodeCompletionController.comp.CompilerOptions.SearchDirectory);
if (CodeCompletionController.comp != null)
Dirs.AddRange(CodeCompletionController.comp.CompilerOptions.SearchDirectory);
if (CodeCompletionController.StandartDirectories.ContainsKey(LibSourceDirectoryIdent))
Dirs.Add((string)CodeCompletionController.StandartDirectories[LibSourceDirectoryIdent]);
return CodeCompletionController.comp.FindSourceFileNameInDirs(unit_name, out found_dir_ind, Dirs.ToArray());
Expand Down
2 changes: 1 addition & 1 deletion CodeCompletion/DomSyntaxTreeVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4829,7 +4829,7 @@ public override void visit(implementation_node _implementation_node)
{
//throw new Exception("The method or operation is not implemented.");
SymScope tmp = cur_scope;
unl.clear();
unl.Clear();
cur_scope = new ImplementationUnitScope(new SymInfo("$implementation", SymbolKind.Namespace, "implementation"), cur_scope);
tmp.AddName("$implementation", cur_scope);
(tmp as InterfaceUnitScope).impl_scope = cur_scope as ImplementationUnitScope;
Expand Down
6 changes: 3 additions & 3 deletions CodeCompletion/SymTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5250,7 +5250,7 @@ public NamespaceScope(string name)
{
this.name = name;
this.si = new SymInfo(name, SymbolKind.Namespace, name);
this.si.description = CodeCompletionController.CurrentParser.LanguageInformation.GetDescription(this);
this.si.description = CodeCompletionController.CurrentParser?.LanguageInformation.GetDescription(this);
}

public override ScopeKind Kind
Expand Down Expand Up @@ -5559,7 +5559,7 @@ public CompiledScope(SymInfo si, Type ctn)
}
if (si.name == null)
AssemblyDocCache.AddDescribeToComplete(this.si, ctn);
this.si.name = CodeCompletionController.CurrentParser.LanguageInformation.GetShortName(this);
this.si.name = CodeCompletionController.CurrentParser?.LanguageInformation.GetShortName(this);
this.si.kind = get_kind();
this.si.description = GetDescription();

Expand Down Expand Up @@ -6196,7 +6196,7 @@ public override void AddIndexer(TypeScope ts, bool is_static)

public override string GetDescription()
{
return CodeCompletionController.CurrentParser.LanguageInformation.GetDescription(this);
return CodeCompletionController.CurrentParser?.LanguageInformation.GetDescription(this);
}

public override SymInfo[] GetNames(ExpressionVisitor ev, PascalABCCompiler.Parsers.KeywordKind keyword, bool called_in_base)
Expand Down
Loading

0 comments on commit 817683f

Please sign in to comment.