markohlebar / Import

Xcode extension for adding imports from anywhere in the code ☝️
MIT License
846 stars 40 forks source link

Failing to import if part of the import matches. #27

Open markohlebar opened 6 years ago

markohlebar commented 6 years ago

Given there is an import already in the source file #import "TMKObject.h"

When I add the import like so and cmd+ctrl+p #import "TMKObjectEquality.h"

Expected: The import is added to the import list.

#import "TMKObject.h"
#import "TMKObjectEquality.h"

Actual: The import is not added to the import list with a message "The import has already been included"

markohlebar commented 6 years ago

@ClementPadovani this might be a regex issue?

clementpadovani commented 6 years ago

Hey, yeah sounds like it.

I think it might come from here https://github.com/markohlebar/Import/blob/master/ImportExtension/AddImportOperation.swift#L15 https://github.com/markohlebar/Import/blob/5c5321a4db574bb5da40f9d9f76e0ec81037da11/ImportExtension/AddImportOperation.swift#L15 Update: Updated code URL to point to the file at that point in history There’s a wildcard for the start of the regexes

clementpadovani commented 6 years ago

Seems fixed with #28

@markohlebar close this issue?