add typescript

pull/5370/head
yann300 3 years ago
parent 614a560ace
commit 356bcb9cb6
  1. 3
      apps/remix-ide/src/app/editor/editor.js
  2. 1
      apps/remix-ide/src/remixAppManager.js
  3. 3
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx
  4. 2
      libs/remix-ui/workspace/src/lib/actions/index.ts
  5. 2
      libs/remix-ui/workspace/src/lib/utils/index.ts

@ -48,7 +48,8 @@ class Editor extends Plugin {
json: 'json',
abi: 'json',
rs: 'rust',
cairo: 'cairo'
cairo: 'cairo',
ts: 'typescript'
}
this.activated = false

@ -132,6 +132,7 @@ export class RemixAppManager extends PluginManager {
}
}
return plugins.map(plugin => {
if (plugin.name === 'scriptRunner') plugin.url = 'http://127.0.0.1:8081'
return new IframePlugin(plugin)
// return new IframeReactPlugin(plugin)
})

@ -4,7 +4,7 @@ import Editor, { loader } from '@monaco-editor/react'
import { reducerActions, reducerListener, initialState } from './actions/editor'
import { language, conf } from './syntax'
import { cairoLang, cairoConf } from './cairoSyntax'
import { ethers } from 'ethers'
import './remix-ui-editor.css'
type cursorPosition = {
@ -223,6 +223,7 @@ export const EditorUI = (props: EditorUIProps) => {
useEffect(() => {
if (!monacoRef.current) return
defineAndSetTheme(monacoRef.current)
monacoRef.current.languages.typescript.typescriptDefaults.addExtraLib('declare function require(module: string): any;')
})

@ -252,7 +252,7 @@ export const runScript = async (path: string) => {
if (error) {
return dispatch(displayPopUp(error))
}
plugin.call('scriptRunner', 'execute', content)
plugin.call('scriptRunner', 'execute', content, path)
})
}

@ -27,7 +27,7 @@ export const contextMenuActions: MenuItems = [{
}, {
id: 'run',
name: 'Run',
extension: ['.js'],
extension: ['.js', '.ts'],
multiselect: false,
label: ''
}, {

Loading…
Cancel
Save