Ejemplo n.º 1
0
        public static DkmInstructionSymbol[] FindSymbols(DkmResolvedDocument resolvedDocument, DkmTextSpan textSpan, string text, out DkmSourcePosition[] symbolLocation) {
            var sourceFileId = DkmSourceFileId.Create(resolvedDocument.DocumentName, null, null, null);
            var resultSpan = new DkmTextSpan(textSpan.StartLine, textSpan.StartLine, 0, 0);
            symbolLocation = new[] { DkmSourcePosition.Create(sourceFileId, resultSpan) };

            var location = new SourceLocation(resolvedDocument.DocumentName, textSpan.StartLine);
            var encodedLocation = location.Encode();
            return new[] { DkmCustomInstructionSymbol.Create(resolvedDocument.Module, Guids.PythonRuntimeTypeGuid, encodedLocation, 0, encodedLocation) };
        }
Ejemplo n.º 2
0
        public static DkmInstructionSymbol[] FindSymbols(DkmResolvedDocument resolvedDocument, DkmTextSpan textSpan, string text, out DkmSourcePosition[] symbolLocation)
        {
            var sourceFileId = DkmSourceFileId.Create(resolvedDocument.DocumentName, null, null, null);
            var resultSpan   = new DkmTextSpan(textSpan.StartLine, textSpan.StartLine, 0, 0);

            symbolLocation = new[] { DkmSourcePosition.Create(sourceFileId, resultSpan) };

            var location        = new SourceLocation(resolvedDocument.DocumentName, textSpan.StartLine);
            var encodedLocation = location.Encode();

            return(new[] { DkmCustomInstructionSymbol.Create(resolvedDocument.Module, Guids.PythonRuntimeTypeGuid, encodedLocation, 0, encodedLocation) });
        }
Ejemplo n.º 3
0
        DkmInstructionSymbol[] IDkmSymbolDocumentSpanQuery.FindSymbols(DkmResolvedDocument resolvedDocument, DkmTextSpan textSpan, string text, out DkmSourcePosition[] symbolLocation)
        {
            if (resolvedDocument.Module.CompilerId.LanguageId != Guids.PythonLanguageGuid)
            {
                Debug.Fail("Non-Python module passed to FindSymbols.");
                throw new NotSupportedException();
            }

            return(ModuleManager.FindSymbols(resolvedDocument, textSpan, text, out symbolLocation));
        }
 internal static EnC.SourceSpan ToSourceSpan(this DkmTextSpan span)
 {
     // ignore invalid/unsupported spans - they might come from stack frames of non-managed languages
     if (span.StartLine <= 0 || span.EndLine <= 0)
     {
         return(default);