This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace JavaLanguageService.Panes | |
{ | |
using System; | |
using System.Diagnostics.Contracts; | |
using Microsoft.VisualStudio; | |
using Microsoft.VisualStudio.Shell.Interop; | |
internal sealed class VsOutputWindowPaneAdapter : IOutputWindowPane, IDisposable | |
{ | |
private IVsOutputWindowPane _pane; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace JavaLanguageService.Extensions | |
{ | |
using System; | |
using System.Diagnostics.Contracts; | |
using System.Runtime.InteropServices; | |
using Microsoft.VisualStudio; | |
using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; | |
public static class ServiceProviderExtensions | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grammar example; | |
start: keyword+ EOF; | |
keyword: A1 | |
| A2 | |
| A3 | |
| A4 | |
| A5 | |
| A6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the main visitor implementation | |
class FooVisitor extends SomeBaseVisitor<T> { | |
} | |
// extend the visitor with hooks for a listener | |
class FooListenerVisitor extends FooVisitor { | |
private ParseTreeListener listener; | |
public FooListenerVisitor(ParseTreeListener listener) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grammar SimplePolicy; | |
options { | |
language = Java; | |
backtrack = true; | |
} | |
@header { | |
package com.manager.impl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FileSystem fileSystem = FileUtil.createMemoryFileSystem(); | |
// Store the actual text that will be displayed to the memory file system | |
FileObject tempFileObject = FileUtil.copyFile(FileUtil.toFileObject(inputFile), fileSystem.getRoot(), inputFile.getName(), "linterp"); | |
DataObject od = DataObject.find(tempFileObject); | |
EditorCookie ec = od.getLookup().lookup(EditorCookie.class); | |
Document opened = ec.openDocument(); | |
if (opened != null) { | |
// here I add the additional data as a property to the Document without needing to serialize it | |
opened.putProperty(LexerDebuggerEditorKit.PROP_INTERP_DATA, lexerInterpreterData); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.uiuc</groupId> | |
<artifactId>cchistory</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<name>CodeCompletionWithHistory</name> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
using Microsoft.VisualStudio; | |
using Microsoft.VisualStudio.TextManager.Interop; | |
[Guid("your guid here")] | |
internal class ExampleLanguageInfo : IVsLanguageInfo | |
{ | |
public int GetCodeWindowManager(IVsCodeWindow pCodeWin, out IVsCodeWindowManager ppCodeWinMgr) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
using Microsoft.VisualStudio.Shell; | |
using IServiceContainer = System.ComponentModel.Design.IServiceContainer; | |
[PackageRegistration(UseManagedResourcesOnly = true)] | |
[InstalledProductRegistration("#110", "#111", "1.0")] | |
[ProvideLanguageService(typeof(ExampleLanguageInfo), "Example", 100)] | |
[ProvideLanguageExtension(typeof(ExampleLanguageInfo), ".e1")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel.Composition; | |
using Microsoft.VisualStudio.Utilities; | |
public static class ExampleDefinitions | |
{ | |
/* The language name (used for the language service) and content type must be the same | |
* due to the way Visual Studio internally registers file extensions and content types. | |
*/ | |
[Export] | |
[Name("Example")] |