@atlaspack/reporter-lsp 2.12.1-dev.3368 → 2.12.1-dev.3401

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,9 +87,9 @@ const ignoreFail = func => {
87
87
  /**/
88
88
  }
89
89
  };
90
- const BASEDIR = _fs().default.realpathSync(_path().default.join(_os().default.tmpdir(), 'atlaspack-lsp'));
91
- const SOCKET_FILE = _path().default.join(BASEDIR, `atlaspack-${process.pid}`);
92
- const META_FILE = _path().default.join(BASEDIR, `atlaspack-${process.pid}.json`);
90
+ const BASEDIR = _fs().default.realpathSync(_path().default.join(_os().default.tmpdir(), 'parcel-lsp'));
91
+ const SOCKET_FILE = _path().default.join(BASEDIR, `parcel-${process.pid}`);
92
+ const META_FILE = _path().default.join(BASEDIR, `parcel-${process.pid}.json`);
93
93
  let workspaceDiagnostics = new (_utils().DefaultMap)(() => []);
94
94
  const getWorkspaceDiagnostics = () => [...workspaceDiagnostics].map(([uri, diagnostics]) => ({
95
95
  uri,
@@ -137,7 +137,7 @@ async function doWatchStart(options) {
137
137
  // by a process that quit unexpectedly.
138
138
  for (let filename of _fs().default.readdirSync(BASEDIR)) {
139
139
  if (filename.endsWith('.json')) continue;
140
- let pid = parseInt(filename.slice('atlaspack-'.length), 10);
140
+ let pid = parseInt(filename.slice('parcel-'.length), 10);
141
141
  let resultList = await lookupPid({
142
142
  pid
143
143
  });
@@ -241,8 +241,8 @@ function sendDiagnostics() {
241
241
  // console.log('send', getWorkspaceDiagnostics());
242
242
  connections.forEach(c => c.sendNotification(_lspProtocol().NotificationWorkspaceDiagnostics, getWorkspaceDiagnostics()));
243
243
  }
244
- function updateDiagnostics(atlaspackDiagnostics, atlaspackSeverity, projectRoot) {
245
- for (let diagnostic of atlaspackDiagnostics) {
244
+ function updateDiagnostics(parcelDiagnostics, parcelSeverity, projectRoot) {
245
+ for (let diagnostic of parcelDiagnostics) {
246
246
  const codeFrames = diagnostic.codeFrames;
247
247
  if (codeFrames == null) {
248
248
  continue;
@@ -254,7 +254,7 @@ function updateDiagnostics(atlaspackDiagnostics, atlaspackSeverity, projectRoot)
254
254
  }
255
255
 
256
256
  // We use the first highlight of the first codeFrame as the main Diagnostic,
257
- // and we place everything else in the current Atlaspack diagnostic
257
+ // and we place everything else in the current Parcel diagnostic
258
258
  // in relatedInformation
259
259
  // https://code.visualstudio.com/api/references/vscode-api#DiagnosticRelatedInformation
260
260
  const firstFrameHighlight = codeFrames[0].codeHighlights[0];
@@ -298,7 +298,7 @@ function updateDiagnostics(atlaspackDiagnostics, atlaspackSeverity, projectRoot)
298
298
  }
299
299
  },
300
300
  source: diagnostic.origin,
301
- severity: (0, _utils2.atlaspackSeverityToLspSeverity)(atlaspackSeverity),
301
+ severity: (0, _utils2.parcelSeverityToLspSeverity)(parcelSeverity),
302
302
  message: diagnostic.message + (firstFrameHighlight.message == null ? '' : ' ' + firstFrameHighlight.message),
303
303
  relatedInformation
304
304
  });
package/lib/utils.js CHANGED
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DiagnosticTag = exports.DiagnosticSeverity = void 0;
7
- exports.atlaspackSeverityToLspSeverity = atlaspackSeverityToLspSeverity;
8
7
  exports.normalizeFilePath = normalizeFilePath;
8
+ exports.parcelSeverityToLspSeverity = parcelSeverityToLspSeverity;
9
9
  function _path() {
10
10
  const data = _interopRequireDefault(require("path"));
11
11
  _path = function () {
@@ -14,8 +14,8 @@ function _path() {
14
14
  return data;
15
15
  }
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
- function atlaspackSeverityToLspSeverity(atlaspackSeverity) {
18
- switch (atlaspackSeverity) {
17
+ function parcelSeverityToLspSeverity(parcelSeverity) {
18
+ switch (parcelSeverity) {
19
19
  case 'error':
20
20
  return DiagnosticSeverity.Error;
21
21
  case 'warn':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/reporter-lsp",
3
- "version": "2.12.1-dev.3368+af1db7f65",
3
+ "version": "2.12.1-dev.3401+b483af77f",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -13,16 +13,16 @@
13
13
  "source": "src/LspReporter.js",
14
14
  "engines": {
15
15
  "node": ">= 16.0.0",
16
- "atlaspack": "^2.12.1-dev.3368+af1db7f65"
16
+ "parcel": "^2.12.1-dev.3401+b483af77f"
17
17
  },
18
18
  "dependencies": {
19
- "@atlaspack/lsp-protocol": "2.12.1-dev.3368+af1db7f65",
20
- "@atlaspack/plugin": "2.12.1-dev.3368+af1db7f65",
21
- "@atlaspack/utils": "2.12.1-dev.3368+af1db7f65",
19
+ "@atlaspack/lsp-protocol": "2.12.1-dev.3401+b483af77f",
20
+ "@atlaspack/plugin": "2.12.1-dev.3401+b483af77f",
21
+ "@atlaspack/utils": "2.12.1-dev.3401+b483af77f",
22
22
  "node-ipc": "^9.1.4",
23
23
  "nullthrows": "^1.1.1",
24
24
  "ps-node": "^0.1.6",
25
25
  "vscode-jsonrpc": "^8.0.2"
26
26
  },
27
- "gitHead": "af1db7f65c4816917ddf83716deedc536a1b8b27"
27
+ "gitHead": "b483af77f02d1258c8dad156e097b94f83671d8e"
28
28
  }
@@ -1,11 +1,11 @@
1
1
  // @flow strict-local
2
2
 
3
- import type {Diagnostic as AtlaspackDiagnostic} from '@atlaspack/diagnostic';
3
+ import type {Diagnostic as ParcelDiagnostic} from '@atlaspack/diagnostic';
4
4
  import type {BundleGraph, FilePath, PackagedBundle} from '@atlaspack/types';
5
5
  import type {Program, Query} from 'ps-node';
6
6
  import type {Diagnostic, DocumentUri} from 'vscode-languageserver';
7
7
  import type {MessageConnection} from 'vscode-jsonrpc/node';
8
- import type {AtlaspackSeverity} from './utils';
8
+ import type {ParcelSeverity} from './utils';
9
9
 
10
10
  import {
11
11
  DefaultMap,
@@ -34,7 +34,7 @@ import {
34
34
  DiagnosticSeverity,
35
35
  DiagnosticTag,
36
36
  normalizeFilePath,
37
- atlaspackSeverityToLspSeverity,
37
+ parcelSeverityToLspSeverity,
38
38
  } from './utils';
39
39
  import type {FSWatcher} from 'fs';
40
40
 
@@ -48,9 +48,9 @@ const ignoreFail = func => {
48
48
  }
49
49
  };
50
50
 
51
- const BASEDIR = fs.realpathSync(path.join(os.tmpdir(), 'atlaspack-lsp'));
52
- const SOCKET_FILE = path.join(BASEDIR, `atlaspack-${process.pid}`);
53
- const META_FILE = path.join(BASEDIR, `atlaspack-${process.pid}.json`);
51
+ const BASEDIR = fs.realpathSync(path.join(os.tmpdir(), 'parcel-lsp'));
52
+ const SOCKET_FILE = path.join(BASEDIR, `parcel-${process.pid}`);
53
+ const META_FILE = path.join(BASEDIR, `parcel-${process.pid}.json`);
54
54
 
55
55
  let workspaceDiagnostics: DefaultMap<
56
56
  string,
@@ -108,7 +108,7 @@ async function doWatchStart(options) {
108
108
  // by a process that quit unexpectedly.
109
109
  for (let filename of fs.readdirSync(BASEDIR)) {
110
110
  if (filename.endsWith('.json')) continue;
111
- let pid = parseInt(filename.slice('atlaspack-'.length), 10);
111
+ let pid = parseInt(filename.slice('parcel-'.length), 10);
112
112
  let resultList = await lookupPid({pid});
113
113
  if (resultList.length > 0) continue;
114
114
  fs.unlinkSync(path.join(BASEDIR, filename));
@@ -241,11 +241,11 @@ function sendDiagnostics() {
241
241
  }
242
242
 
243
243
  function updateDiagnostics(
244
- atlaspackDiagnostics: Array<AtlaspackDiagnostic>,
245
- atlaspackSeverity: AtlaspackSeverity,
244
+ parcelDiagnostics: Array<ParcelDiagnostic>,
245
+ parcelSeverity: ParcelSeverity,
246
246
  projectRoot: FilePath,
247
247
  ): void {
248
- for (let diagnostic of atlaspackDiagnostics) {
248
+ for (let diagnostic of parcelDiagnostics) {
249
249
  const codeFrames = diagnostic.codeFrames;
250
250
  if (codeFrames == null) {
251
251
  continue;
@@ -258,7 +258,7 @@ function updateDiagnostics(
258
258
  }
259
259
 
260
260
  // We use the first highlight of the first codeFrame as the main Diagnostic,
261
- // and we place everything else in the current Atlaspack diagnostic
261
+ // and we place everything else in the current Parcel diagnostic
262
262
  // in relatedInformation
263
263
  // https://code.visualstudio.com/api/references/vscode-api#DiagnosticRelatedInformation
264
264
  const firstFrameHighlight = codeFrames[0].codeHighlights[0];
@@ -307,7 +307,7 @@ function updateDiagnostics(
307
307
  },
308
308
  },
309
309
  source: diagnostic.origin,
310
- severity: atlaspackSeverityToLspSeverity(atlaspackSeverity),
310
+ severity: parcelSeverityToLspSeverity(parcelSeverity),
311
311
  message:
312
312
  diagnostic.message +
313
313
  (firstFrameHighlight.message == null
package/src/utils.js CHANGED
@@ -4,12 +4,12 @@ import type {ODiagnosticSeverity} from 'vscode-languageserver';
4
4
 
5
5
  import path from 'path';
6
6
 
7
- export type AtlaspackSeverity = DiagnosticLogEvent['level'];
7
+ export type ParcelSeverity = DiagnosticLogEvent['level'];
8
8
 
9
- export function atlaspackSeverityToLspSeverity(
10
- atlaspackSeverity: AtlaspackSeverity,
9
+ export function parcelSeverityToLspSeverity(
10
+ parcelSeverity: ParcelSeverity,
11
11
  ): ODiagnosticSeverity {
12
- switch (atlaspackSeverity) {
12
+ switch (parcelSeverity) {
13
13
  case 'error':
14
14
  return DiagnosticSeverity.Error;
15
15
  case 'warn':