Exemple #1
0
            public void Execute(Action <DaemonStageResult> committer)
            {
                var highlightings = new List <HighlightingInfo>();

                foreach (var treeNode in myFile.Descendants())
                {
                    if (treeNode is PsiBuilderErrorElement error)
                    {
                        var range = error.GetDocumentRange();
                        highlightings.Add(new HighlightingInfo(range, new CSharpSyntaxError(error.ErrorDescription, range)));
                    }

                    if (treeNode is Spring_FunctionIdentifier id)
                    {
                        foreach (var reference in id.GetFirstClassReferences())
                        {
                            if (!reference.Resolve().Info.ResolveErrorType.IsAcceptable&& !SpringLanguage.BuiltinNames.Contains(id.GetText()))
                            {
                                var range = id.GetDocumentRange();
                                highlightings.Add(new HighlightingInfo(range, new CSharpSyntaxError("Unresolved function name", range)));
                            }
                        }
                    }
                }

                var result = new DaemonStageResult(highlightings);

                committer(result);
            }
Exemple #2
0
            public void Execute(Action <DaemonStageResult> committer)
            {
                var highlightings = new List <HighlightingInfo>();

                foreach (var treeNode in myFile.Descendants())
                {
                    if (treeNode is SpringPsiBuilderErrorElement error)
                    {
                        var range = error.GetDocumentRange().ExtendRight(error.Length);

                        highlightings.Add(error.IsSyntaxError
                            ? new HighlightingInfo(range, new CSharpSyntaxError(error.ErrorDescription, range))
                            : new HighlightingInfo(range, new SpringUnresolvedError(error.ErrorDescription, range)));
                    }
                    else
                    {
                        foreach (var reference in _factory.GetReferences(treeNode, ReferenceCollection.Empty))
                        {
                            if (reference.Resolve().Info.ResolveErrorType != ResolveErrorType.OK)
                            {
                                var range = reference.GetDocumentRange();
                                highlightings.Add(new HighlightingInfo(range, new SpringUnresolvedError("Can't resolve identifier", range)));
                            }
                        }
                    }
                }

                var result = new DaemonStageResult(highlightings);

                committer(result);
            }
Exemple #3
0
            public void Execute(Action <DaemonStageResult> committer)
            {
                var highlightings = new List <HighlightingInfo>();

                foreach (var treeNode in myFile.Descendants())
                {
                    if (treeNode is PsiBuilderErrorElement error)
                    {
                        var range = error.GetDocumentRange();
                        highlightings.Add(new HighlightingInfo(range, new CSharpSyntaxError(error.ErrorDescription, range)));
                    }
                }

                var result = new DaemonStageResult(highlightings);

                committer(result);
            }
            public void Execute(Action <DaemonStageResult> committer)
            {
                var highlightings = new List <HighlightingInfo>();

                foreach (var treeNode in myFile.Descendants())
                {
                    switch (treeNode)
                    {
                    case PsiBuilderErrorElement error:
                    {
                        var range = error.GetDocumentRange();
                        highlightings.Add(new HighlightingInfo(range,
                                                               new CSharpSyntaxError(error.ErrorDescription, range)));
                        break;
                    }

                    case SpringIdent refer:
                    {
                        var refs = refer.GetFirstClassReferences();
                        foreach (var reff in refs)
                        {
                            if (reff.Resolve().Info.ResolveErrorType == ResolveErrorType.OK)
                            {
                                continue;
                            }
                            var rangeR = reff.GetDocumentRange();
                            if (!rangeR.IsEmpty)
                            {
                                highlightings.Add(new HighlightingInfo(rangeR,
                                                                       new CSharpSyntaxError("Cannot resolve a symbol", rangeR)));
                            }
                        }

                        break;
                    }
                    }
                }

                var result = new DaemonStageResult(highlightings);

                committer(result);
            }