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

Bring Dev up to date #5

Merged
merged 7 commits into from
Aug 30, 2024
Merged
Changes from 1 commit
Commits
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
Next Next commit
fix: bug in launching extension
ZanzyTHEbar committed Jun 30, 2024
commit afb4a89b99c2783bf8cb8e4ea6a004e52c514a5c
24 changes: 12 additions & 12 deletions gnome-extension/src/extension.ts
Original file line number Diff line number Diff line change
@@ -52,6 +52,8 @@ export default class VSCodeWorkspacesExtension extends Extension {
//_notification: MessageTray.Notification | null = null;

enable() {
this.gsettings = this.getSettings();

this._indicator = new PanelMenu.Button(0.0, this.metadata.name, false);

const icon = new St.Icon({
@@ -61,13 +63,12 @@ export default class VSCodeWorkspacesExtension extends Extension {

this._indicator.add_child(icon);

this._createMenu();

Main.panel.addToStatusArea(this.metadata.uuid, this._indicator);

this._startRefresh();

this.gsettings = this.getSettings();
this._setSettings();
this._createMenu();

this.gsettings.connect('changed', () => {
this._setSettings();
@@ -88,7 +89,6 @@ export default class VSCodeWorkspacesExtension extends Extension {
this._log(`Refresh Interval: ${this._refreshInterval}`);
this._log(`Prefer Code Workspace File: ${this._preferCodeWorkspaceFile}`);
this._log(`Debug: ${this._debug}`);

}

disable() {
@@ -409,29 +409,29 @@ export default class VSCodeWorkspacesExtension extends Extension {
});

// sort the workspace files by access time
/* this._workspaces = new Set(Array.from(this._workspaces).sort((a, b) => {
this._workspaces = new Set(Array.from(this._workspaces).sort((a, b) => {

const aInfo = Gio.File.new_for_uri(a.uri).query_info('standard::*,unix::atime', Gio.FileQueryInfoFlags.NONE, null);
const bInfo = Gio.File.new_for_uri(b.uri).query_info('standard::*,unix::atime', Gio.FileQueryInfoFlags.NONE, null);

if (!aInfo || !bInfo) {
this._log(`No file info found for ${a} or ${b}`);
return 0;
}

const aAccessTime = aInfo.get_attribute_uint64('unix::atime');
const bAccessTime = bInfo.get_attribute_uint64('unix::atime');

if (aAccessTime > bAccessTime) {
return -1;
}

if (aAccessTime < bAccessTime) {
return 1;
}

return 0;
})); */
}));
// this._log the Set of workspaces, given that .values() returns an iterator
this._log(`[Workspace Cache]: ${Array.from(this._workspaces).map(workspace => workspace.uri)}`);