Skip to content

Commit

Permalink
Chore: Improve bb imports
Browse files Browse the repository at this point in the history
  • Loading branch information
idillon-sfl committed Jan 8, 2024
1 parent 93ec7e7 commit d0f67b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions client/src/language/middlewareDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ const getDefinitionOfD = async <DefinitionType extends Location | LocationLink>(
return await redirectDefinition(definition, dRange, dataSmartPosition)
}

export const eRange = new Range(4, 0, 4, 1) // Where `e` is located in the embedded language document
export const eventPosition = new Position(4, 12) // Where `Event` (event.Event()) is reachable in the embedded language document
export const eRange = new Range(3, 0, 3, 1) // Where `e` is located in the embedded language document
export const eventPosition = new Position(3, 14) // Where `Event` (event.Event()) is reachable in the embedded language document

// Handle `e` in `e.data.getVar('')`
const getDefinitionOfE = async <DefinitionType extends Location | LocationLink>(
Expand Down
10 changes: 4 additions & 6 deletions server/src/embedded-languages/python-support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ import { embeddedLanguageDocsManager } from './documents-manager'
import { type EmbeddedLanguageDoc, insertTextIntoEmbeddedLanguageDoc, initEmbeddedLanguageDoc } from './utils'

export const imports = [
'import bb',
'from bb import data_smart',
'd = data_smart.DataSmart()',
'from bb import event',
'e = event.Event()',
'import bb, bb.build, bb.compress.zstd, bb.data, bb.data_smart, bb.event, bb.fetch2, bb.parse, bb.persist_data, bb.process, bb.progress, bb.runqueue, bb.siggen, bb.utils',
'import oe.data, oe.path, oe.utils, oe.types, oe.package, oe.packagegroup, oe.sstatesig, oe.lsb, oe.cachedpath, oe.license, oe.qa, oe.reproducible, oe.rust, oe.buildcfgoe',
'd = bb.data_smart.DataSmart()',
'e = bb.event.Event()',
'e.data = d',
'import os',
'import oe.data, oe.path, oe.utils, oe.types, oe.package, oe.packagegroup, oe.sstatesig, oe.lsb, oe.cachedpath, oe.license, oe.qa, oe.reproducible, oe.rust, oe.buildcfgoe',
''
].join('\n')

Expand Down

0 comments on commit d0f67b8

Please sign in to comment.