scope-tree

Module scope tree for CodeInspector

Usage no npm install needed!

<script type="module">
  import scopeTree from 'https://cdn.skypack.dev/scope-tree';
</script>

README

Scope Tree

Module scope

const moduleScope = new ModuleScope()
moduleScope.addImport('any', 'Banana', Banana)

Function scope

const functionScope = new FunctionScope()
functionScope.addVariable('const', 'any', 'banana', 'Banana')

Class scope

const classScope = new ClassScope()
classScope.addMethod('any', 'getFruit', [
  ['any', 'name']
])