Skip to content

Commit

Permalink
Fix 'terminal' extension typos
Browse files Browse the repository at this point in the history
- fixes `@theia/terminal` extension typos.
- renames `TerminalCopyOnSelectionHander` to `TerminalCopyOnSelectionHandler`.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
  • Loading branch information
vince-fugnitto committed Dec 4, 2019
1 parent d5c8110 commit e2f6dba
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

Breaking changes:

- [core] new browser windows spawned through opener-service have noopener set, preventing them from accessing window.opener and giveing them their own event loop. openNewWindow will no longer return a Window as a result.
- [core] new browser windows spawned through opener-service have noopener set, preventing them from accessing window.opener and giving them their own event loop. openNewWindow will no longer return a Window as a result.
- [terminal] renamed `TerminalCopyOnSelectionHander` to `TerminalCopyOnSelectionHandler` []()

## v0.13.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { injectable, postConstruct } from 'inversify';
import { isFirefox } from '@theia/core/lib/browser';

@injectable()
export class TerminalCopyOnSelectionHander {
export class TerminalCopyOnSelectionHandler {

private textToCopy: string;
private interceptCopy: boolean;
Expand All @@ -36,18 +36,18 @@ export class TerminalCopyOnSelectionHander {
}

private async clipBoardCopyIsGranted(): Promise<boolean> {
// Unfortunately Firefox doesn't support permission check `clipboard-write`, so let try to copy anyway,
if (isFirefox) {
// Unfortunately Firefox doesn't support permission check `clipboard-write`, so let try to copy anyway,
if (isFirefox) {
return true;
}
try {
// tslint:disable-next-line:no-any
const permissions = (navigator as any).permissions;
const { state } = await permissions.query({name: 'clipboard-write'});
const { state } = await permissions.query({ name: 'clipboard-write' });
if (state === 'granted') {
return true;
}
} catch (e) {}
} catch (e) { }

return false;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/terminal/src/browser/terminal-frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { TerminalQuickOpenService, TerminalQuickOpenContribution } from './termi

import '../../src/browser/terminal.css';
import 'xterm/lib/xterm.css';
import { TerminalCopyOnSelectionHander } from './terminal-copy-on-selection-handler';
import { TerminalCopyOnSelectionHandler } from './terminal-copy-on-selection-handler';

export default new ContainerModule(bind => {
bindTerminalPreferences(bind);
Expand Down Expand Up @@ -68,7 +68,7 @@ export default new ContainerModule(bind => {
}));

bind(TerminalQuickOpenService).toSelf().inSingletonScope();
bind(TerminalCopyOnSelectionHander).toSelf().inSingletonScope();
bind(TerminalCopyOnSelectionHandler).toSelf().inSingletonScope();

bind(TerminalQuickOpenContribution).toSelf().inSingletonScope();
for (const identifier of [CommandContribution, QuickOpenContribution]) {
Expand Down
6 changes: 3 additions & 3 deletions packages/terminal/src/browser/terminal-linkmatcher-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class TerminalLinkmatcherFiles extends AbstractCmdClickTerminalContributi
}
}

// below reg exps are taken from
// The following regular expressions are taken from:
// https://github.com/microsoft/vscode/blob/fbbc1aa80332189aa0d3006cb2159b79a9eba480/src/vs/workbench/contrib/terminal/browser/terminalLinkHandler.ts

/*---------------------------------------------------------------------------------------------
Expand All @@ -142,7 +142,7 @@ export class TerminalLinkmatcherFiles extends AbstractCmdClickTerminalContributi
const pathPrefix = '(\\.\\.?|\\~)';
const pathSeparatorClause = '\\/';
// '":; are allowed in paths but they are often separators so ignore them
// Also disallow \\ to prevent a catastropic backtracking case #24798
// Also disallow \\ to prevent a catastrophic backtracking case #24798
const excludedPathCharactersClause = '[^\\0\\s!$`&*()\\[\\]+\'":;\\\\]';
/** A regex that matches paths in the form /foo, ~/foo, ./foo, ../foo, foo/bar */
const unixLocalLinkClause = '((' + pathPrefix + '|(' + excludedPathCharactersClause + ')+)?(' + pathSeparatorClause + '(' + excludedPathCharactersClause + ')+)+)';
Expand All @@ -154,7 +154,7 @@ const winExcludedPathCharactersClause = '[^\\0<>\\?\\|\\/\\s!$`&*()\\[\\]+\'":;]
/** A regex that matches paths in the form c:\foo, ~\foo, .\foo, ..\foo, foo\bar */
const winLocalLinkClause = '((' + winPathPrefix + '|(' + winExcludedPathCharactersClause + ')+)?(' + winPathSeparatorClause + '(' + winExcludedPathCharactersClause + ')+)+)';

/** As xterm reads from DOM, space in that case is nonbreaking char ASCII code - 160, replacing space with nonBreakningSpace or space ASCII code - 32. */
/** As xterm reads from DOM, space in that case is non-breaking char ASCII code - 160, replacing space with nonBreakingSpace or space ASCII code - 32. */
const lineAndColumnClause = [
// "(file path)", line 45 [see #40468]
'((\\S*)", line ((\\d+)( column (\\d+))?))',
Expand Down
4 changes: 2 additions & 2 deletions packages/terminal/src/browser/terminal-widget-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { TerminalPreferences, TerminalRendererType, isTerminalRendererType, DEFA
import { TerminalContribution } from './terminal-contribution';
import URI from '@theia/core/lib/common/uri';
import { TerminalService } from './base/terminal-service';
import { TerminalCopyOnSelectionHander } from './terminal-copy-on-selection-handler';
import { TerminalCopyOnSelectionHandler } from './terminal-copy-on-selection-handler';

export const TERMINAL_WIDGET_FACTORY_ID = 'terminal';

Expand Down Expand Up @@ -76,7 +76,7 @@ export class TerminalWidgetImpl extends TerminalWidget implements StatefulWidget
@inject(TerminalPreferences) protected readonly preferences: TerminalPreferences;
@inject(ContributionProvider) @named(TerminalContribution) protected readonly terminalContributionProvider: ContributionProvider<TerminalContribution>;
@inject(TerminalService) protected readonly terminalService: TerminalService;
@inject(TerminalCopyOnSelectionHander) protected readonly copyOnSelectionHandler: TerminalCopyOnSelectionHander;
@inject(TerminalCopyOnSelectionHandler) protected readonly copyOnSelectionHandler: TerminalCopyOnSelectionHandler;

protected readonly onDidOpenEmitter = new Emitter<void>();
readonly onDidOpen: Event<void> = this.onDidOpenEmitter.event;
Expand Down
2 changes: 1 addition & 1 deletion packages/terminal/src/node/terminal-server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { ITerminalServer } from '../common/terminal-protocol';

const expect = chai.expect;

describe('TermninalServer', function (): void {
describe('TerminalServer', function (): void {

this.timeout(5000);
let terminalServer: ITerminalServer;
Expand Down

0 comments on commit e2f6dba

Please sign in to comment.