Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone compiler API #568

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Standalone compiler API #568

wants to merge 1 commit into from

Conversation

jmbockhorst
Copy link
Member

@jmbockhorst jmbockhorst commented Mar 31, 2021

Refactor the compiler api so that it can be used as a standalone application by other projects.

Usage would look like

import { createProgram } from '@elm-tooling/elm-language-server';

const program = await createProgram(URI.parse('path-root-root-uri'));

const checker = program.getTypeChecker();
const sourceFile = program.getSourceFile('some-file-uri');

sourceFile.tree.rootNode.children.forEach((node) => {
	if (node.type === 'value_declaration') {
		const type = checker.findType(node);
	}
});

@jmbockhorst jmbockhorst added this to the 2.2 milestone Mar 31, 2021
@jmbockhorst jmbockhorst modified the milestones: 2.2, 2.3 Aug 31, 2021
@jmbockhorst jmbockhorst force-pushed the compiler-api branch 2 times, most recently from 6ec3d03 to 50b2132 Compare August 31, 2021 03:49
@razzeee razzeee modified the milestones: 2.3, Backlog Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants