diff --git a/src/data.preview.ts b/src/data.preview.ts index c178a7b..76f31f0 100644 --- a/src/data.preview.ts +++ b/src/data.preview.ts @@ -149,7 +149,7 @@ export class DataPreview { this._dataViews = (views !== undefined) ? views: {}; this._viewConfig = viewConfig; this._fileName = path.basename(uri.fsPath); - this._fileExtension = this._fileName.substr(this._fileName.lastIndexOf('.')); + this._fileExtension = path.extname(this._fileName); // file extension this._previewUri = this._uri.with({scheme: 'data'}); // parse view config