public static IEnumerable <INavigationToken> GetInstructionsByName(this IInstructionListManager instructionList, AsmType asmType, string instruction)
        {
            var instructions = instructionList.GetSelectedSetInstructions(asmType);

            return(instructions
                   .Where(i => i.Text == instruction)
                   .SelectMany(i => i.Navigations));
        }
 public SignatureHelpSource(IDocumentAnalysis documentAnalysis, IInstructionListManager instructionListManager, 
     ITextBuffer textBuffer, SignatureConfig signatureConfig)
 {
     _documentAnalysis = documentAnalysis;
     _instructionListManager = instructionListManager;
     _textBuffer = textBuffer;
     _signatureConfig = signatureConfig;
 }
Example #3
0
 public CodeDocument(ITextDocumentFactoryService textDocumentFactory,
                     IInstructionListManager instructionListManager,
                     ITextDocument textDocument,
                     ILexer lexer, IParser parser, OnDestroyAction onDestroy)
     : base(textDocumentFactory, textDocument, lexer, parser, onDestroy)
 {
     _instructionListManager = instructionListManager;
     _instructionListManager.InstructionsUpdated += InstructionsUpdated;
 }
Example #4
0
        public static void UpdateInstructions(IInstructionListManager sender, AsmType asmType)
        {
            const AsmType currentAsmType = AsmType.RadAsm2;

            if ((asmType & currentAsmType) != currentAsmType)
            {
                return;
            }

            UpdateInstructions(sender, currentAsmType, ref Instructions, ref OtherInstructions);
        }
Example #5
0
        public CompletionSourceProvider(IInstructionListManager instructionListManager,
                                        IIntellisenseDescriptionBuilder descriptionBuilder,
                                        IDocumentFactory documentFactory,
                                        INavigationTokenService navigationTokenService)
        {
            _descriptionBuilder = descriptionBuilder;
            _documentFactory    = documentFactory;

            var optionProvider = GeneralOptionProvider.Instance;

            _providers = new List <RadCompletionProvider>()
            {
                new InstructionCompletionProvider(optionProvider, instructionListManager),
                new FunctionCompletionProvider(optionProvider, navigationTokenService),
                new ScopedCompletionProvider(optionProvider, navigationTokenService),
            };
        }
Example #6
0
        private void InstructionsUpdated(IInstructionListManager sender, AsmType asmType)
        {
            if ((asmType & AsmType.RadAsm) != 0)
            {
                _asm1InstructionCompletions.Clear();
                _asm1InstructionCompletions.AddRange(
                    sender.GetSelectedSetInstructions(AsmType.RadAsm)
                    .GroupBy(i => i.Text)
                    .Select(g => new InstructionCompletionItem(g, g.Key, Icon))
                    );
            }

            if ((asmType & AsmType.RadAsm2) != 0)
            {
                _asm2InstructionCompletions.Clear();
                _asm2InstructionCompletions.AddRange(
                    sender.GetSelectedSetInstructions(AsmType.RadAsm2)
                    .GroupBy(i => i.Text)
                    .Select(g => new InstructionCompletionItem(g, g.Key, Icon))
                    );
            }
        }
 public NavigationTokenService(IDocumentFactory documentFactory, IInstructionListManager instructionListManager)
 {
     _documentFactory        = documentFactory;
     _instructionListManager = instructionListManager;
 }
Example #8
0
 public SignatureHelpSourceProvider(IDocumentFactory documentFactory, IInstructionListManager instructionListManager)
 {
     _documentFactory        = documentFactory;
     _instructionListManager = instructionListManager;
 }
Example #9
0
 private void InstructionsUpdated(IInstructionListManager sender, Helpers.AsmType asmType) =>
 DocumentAnalysis.Rescan(RescanReason.InstructionsChanged, UpdateCancellation());
Example #10
0
        public InstructionCompletionProvider(GeneralOptionProvider generalOptionProvider, IInstructionListManager instructionListManager)
            : base(generalOptionProvider)
        {
            _autocomplete = generalOptionProvider.AutocompleteInstructions;
            _asm1InstructionCompletions = new List <InstructionCompletionItem>();
            _asm2InstructionCompletions = new List <InstructionCompletionItem>();

            instructionListManager.InstructionsUpdated += InstructionsUpdated;
            InstructionsUpdated(instructionListManager, AsmType.RadAsmCode);
        }