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

Git4 #4563

Closed
wants to merge 65 commits into from
Closed

Git4 #4563

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
df103f9
add git components
bunsenstraat Feb 9, 2024
afce79d
add git plugin
bunsenstraat Feb 9, 2024
097f528
add dgit to app.js
bunsenstraat Feb 9, 2024
a769356
add appman hack
bunsenstraat Feb 9, 2024
eded03f
add git to tsconfig paths
bunsenstraat Feb 9, 2024
236b309
octokit dgitprovider
bunsenstraat Feb 9, 2024
51b2d20
add react select
bunsenstraat Feb 9, 2024
933ae65
font awesome
bunsenstraat Feb 12, 2024
63c15f0
translations
bunsenstraat Feb 15, 2024
88cef7b
context
bunsenstraat Feb 23, 2024
82caba9
refactor
bunsenstraat Feb 23, 2024
6beeda8
remote commits
bunsenstraat Feb 24, 2024
0a5d2e2
add gql
bunsenstraat Feb 26, 2024
4fa7238
codegen
bunsenstraat Feb 26, 2024
4ff34b6
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat Feb 26, 2024
66ef29f
restore ts
bunsenstraat Feb 26, 2024
f4380ce
types for gql
bunsenstraat Feb 28, 2024
affc3e6
use octo
bunsenstraat Feb 29, 2024
019ed19
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat Mar 29, 2024
88c13ff
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat Mar 30, 2024
8a304c0
pagecommits
bunsenstraat Apr 3, 2024
f298ba1
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat Apr 4, 2024
891f10a
git provider
bunsenstraat Apr 4, 2024
d791ff0
ignore
bunsenstraat Apr 7, 2024
5c0a0a6
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat Apr 18, 2024
59ac71f
rename branchcommits
bunsenstraat Apr 18, 2024
ede22d8
branch diffs
bunsenstraat Apr 19, 2024
b3252a0
setdefaultremote
bunsenstraat Apr 19, 2024
02e1d29
BranchDifferences
bunsenstraat Apr 19, 2024
9024f6e
loaders
bunsenstraat Apr 22, 2024
be0be4c
add gui button
bunsenstraat Apr 22, 2024
777f635
add device code
bunsenstraat Apr 22, 2024
c4dce2d
add device flow
bunsenstraat Apr 22, 2024
aee0919
paged fetching data
bunsenstraat Apr 23, 2024
86c8779
rm gql
bunsenstraat Apr 23, 2024
e1fc893
add logger
bunsenstraat Apr 23, 2024
aa7d58b
add logger
bunsenstraat Apr 24, 2024
d843e5c
remote branches
bunsenstraat Apr 27, 2024
d154442
FM diff
bunsenstraat Apr 28, 2024
f8a72e6
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat Apr 28, 2024
27e2c1d
diff
bunsenstraat Apr 29, 2024
5b3df39
rm lint target
bunsenstraat Apr 29, 2024
e1c1d94
change upstream object
bunsenstraat Apr 29, 2024
c46e181
bugfix
bunsenstraat Apr 30, 2024
1e840f4
fix sourcecontrol buttons
bunsenstraat Apr 30, 2024
6a16d54
lint config
bunsenstraat Apr 30, 2024
cc49cc5
lmit script
bunsenstraat Apr 30, 2024
29cb471
sc base
bunsenstraat May 1, 2024
7da0d58
Merge branch 'git4' of https://github.com/ethereum/remix-project into…
bunsenstraat May 1, 2024
32d9abf
lint ide
bunsenstraat May 1, 2024
c3db538
lint remix-ui
bunsenstraat May 1, 2024
c03bb35
remix-lib lint
bunsenstraat May 1, 2024
6cddc4a
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat May 1, 2024
86865cc
git json
bunsenstraat May 2, 2024
0933d66
git buttons
bunsenstraat May 2, 2024
9ade399
ahead of
bunsenstraat May 2, 2024
36ec094
openremote
bunsenstraat May 2, 2024
353b567
listeners
bunsenstraat May 2, 2024
53eee90
fixes
bunsenstraat May 3, 2024
819202b
refresh
bunsenstraat May 3, 2024
74a872f
fetching after push
bunsenstraat May 3, 2024
0a6c952
faglobe
bunsenstraat May 4, 2024
ec4afca
fix workspace connection
bunsenstraat May 4, 2024
41d15a3
refresh
bunsenstraat May 5, 2024
21e7c4f
fix app
bunsenstraat May 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,6 @@ apps/remixdesktop/release/
apps/remix-ide/src/assets/list.json
apps/remix-ide/src/assets/esbuild.wasm
apps/remixdesktop/build*
logs
apps/remixdesktop/reports/
apps/remixdesktop/logs/
logs
7 changes: 6 additions & 1 deletion apps/remix-ide/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import { electronTemplates } from './app/plugins/electron/templatesPlugin'
import { xtermPlugin } from './app/plugins/electron/xtermPlugin'
import { ripgrepPlugin } from './app/plugins/electron/ripgrepPlugin'
import { compilerLoaderPlugin, compilerLoaderPluginDesktop } from './app/plugins/electron/compilerLoaderPlugin'
import { GitPlugin } from './app/plugins/git'

import {OpenAIGpt} from './app/plugins/openaigpt'
import {SolCoder} from './app/plugins/solcoderAI'
Expand Down Expand Up @@ -217,6 +218,9 @@ class AppComponent {
//---- templates
const templates = new TemplatesPlugin()

//---- git
const git = new GitPlugin()

//---------------- Solidity UML Generator -------------------------
const solidityumlgen = new SolidityUmlGen(appManager)

Expand Down Expand Up @@ -351,6 +355,7 @@ class AppComponent {
templates,
openaigpt,
solcoder,
git
])

//---- fs plugin
Expand Down Expand Up @@ -487,7 +492,7 @@ class AppComponent {
])
await this.appManager.activatePlugin(['settings'])

await this.appManager.activatePlugin(['walkthrough', 'storage', 'search', 'compileAndRun', 'recorder'])
await this.appManager.activatePlugin(['walkthrough', 'storage', 'search', 'compileAndRun', 'recorder', 'dgit'])
await this.appManager.activatePlugin(['solidity-script', 'remix-templates'])

if (isElectron()){
Expand Down
35 changes: 28 additions & 7 deletions apps/remix-ide/src/app/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { EditorUI } from '@remix-ui/editor' // eslint-disable-line
import { Plugin } from '@remixproject/engine'
import * as packageJson from '../../../../../package.json'
import { PluginViewWrapper } from '@remix-ui/helper'
import { commitChange } from '@remix-ui/git'

const EventManager = require('../../lib/events')

Expand All @@ -13,7 +14,7 @@ const profile = {
name: 'editor',
description: 'service - editor',
version: packageJson.version,
methods: ['highlight', 'discardHighlight', 'clearAnnotations', 'addLineText', 'discardLineTexts', 'addAnnotation', 'gotoLine', 'revealRange', 'getCursorPosition', 'open', 'addModel','addErrorMarker', 'clearErrorMarkers', 'getText', 'getPositionAt'],
methods: ['highlight', 'discardHighlight', 'clearAnnotations', 'addLineText', 'discardLineTexts', 'addAnnotation', 'gotoLine', 'revealRange', 'getCursorPosition', 'open', 'addModel','addErrorMarker', 'clearErrorMarkers', 'getText', 'getPositionAt', 'openReadOnly'],
}

class Editor extends Plugin {
Expand Down Expand Up @@ -63,7 +64,8 @@ class Editor extends Plugin {
onBreakPointAdded: (file, line) => this.triggerEvent('breakpointAdded', [file, line]),
onBreakPointCleared: (file, line) => this.triggerEvent('breakpointCleared', [file, line]),
onDidChangeContent: (file) => this._onChange(file),
onEditorMounted: () => this.triggerEvent('editorMounted', [])
onEditorMounted: () => this.triggerEvent('editorMounted', []),
onDiffEditorMounted: () => this.triggerEvent('diffEditorMounted', [])
}

// to be implemented by the react component
Expand All @@ -81,8 +83,10 @@ class Editor extends Plugin {
editorAPI={state.api}
themeType={state.currentThemeType}
currentFile={state.currentFile}
currentDiffFile={state.currentDiffFile}
events={state.events}
plugin={state.plugin}
isDiff={state.isDiff}
/>
}

Expand Down Expand Up @@ -111,6 +115,8 @@ class Editor extends Plugin {
api: this.api,
currentThemeType: this.currentThemeType,
currentFile: this.currentFile,
currentDiffFile: this.currentDiffFile,
isDiff: this.isDiff,
events: this.events,
plugin: this
})
Expand Down Expand Up @@ -183,9 +189,10 @@ class Editor extends Plugin {
}

_switchSession (path) {
if (path === this.currentFile) return
this.triggerEvent('sessionSwitched', [])
this.currentFile = path
if (path !== this.currentFile) {
this.triggerEvent('sessionSwitched', [])
this.currentFile = path
}
this.renderComponent()
}

Expand Down Expand Up @@ -241,10 +248,10 @@ class Editor extends Plugin {
* @param {string} content Content of the file to open
* @param {string} mode Mode for this file [Default is `text`]
*/
async _createSession (path, content, mode) {
async _createSession (path, content, mode, readOnly) {
if (!this.activated) return

this.emit('addModel', content, mode, path, this.readOnlySessions[path])
this.emit('addModel', content, mode, path, readOnly || this.readOnlySessions[path])
return {
path,
language: mode,
Expand Down Expand Up @@ -314,6 +321,7 @@ class Editor extends Plugin {
- URL prepended with "browser"
- URL not prepended with the file explorer. We assume (as it is in the whole app, that this is a "browser" URL
*/
this.isDiff = false
if (!this.sessions[path]) {
this.readOnlySessions[path] = false
const session = await this._createSession(path, content, this._getMode(path))
Expand All @@ -335,9 +343,22 @@ class Editor extends Plugin {
const session = await this._createSession(path, content, this._getMode(path))
this.sessions[path] = session
}
this.isDiff = false
this._switchSession(path)
}

async openDiff(change) {
console.log('openDiff', change)
const hashedPathModified = change.readonly ? change.path + change.hashModified : change.path
const hashedPathOriginal = change.path + change.hashOriginal
const session = await this._createSession(hashedPathModified, change.modified, this._getMode(change.path), change.readonly)
await this._createSession(hashedPathOriginal, change.original, this._getMode(change.path), change.readonly)
this.sessions[hashedPathModified] = session
this.currentDiffFile = hashedPathOriginal
this.isDiff = true
this._switchSession(hashedPathModified)
}

/**
* Content of the current session
* @return {String} content of the file referenced by @arg path
Expand Down
Loading
Loading